From 8aff1aa9a1b70a8663f3dc51c4d6dc92828348a5 Mon Sep 17 00:00:00 2001 From: LDprg Date: Thu, 13 Jul 2023 14:50:32 +0200 Subject: [PATCH] Setup basic dependencies --- .gitignore | 6 ++++++ winapps-cli/Cargo.toml | 1 + winapps-cli/src/main.rs | 4 +++- winapps-gui/Cargo.toml | 1 + winapps-gui/src/main.rs | 4 +++- winapps/src/lib.rs | 11 ----------- 6 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5645b34 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# Generated files +*/target/ + +# The library shouldn't decide about the exact versions of +# its dependencies, but let the downstream crate decide. +Cargo.lock \ No newline at end of file diff --git a/winapps-cli/Cargo.toml b/winapps-cli/Cargo.toml index e2af5fb..d6bf493 100644 --- a/winapps-cli/Cargo.toml +++ b/winapps-cli/Cargo.toml @@ -6,3 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +winapps = { path = "../winapps" } diff --git a/winapps-cli/src/main.rs b/winapps-cli/src/main.rs index e7a11a9..e1f4041 100644 --- a/winapps-cli/src/main.rs +++ b/winapps-cli/src/main.rs @@ -1,3 +1,5 @@ +use winapps; + fn main() { - println!("Hello, world!"); + println!("Test lib: {}", winapps::add(1, 2)); } diff --git a/winapps-gui/Cargo.toml b/winapps-gui/Cargo.toml index 0917030..1ad1b98 100644 --- a/winapps-gui/Cargo.toml +++ b/winapps-gui/Cargo.toml @@ -6,3 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +winapps = { path = "../winapps" } \ No newline at end of file diff --git a/winapps-gui/src/main.rs b/winapps-gui/src/main.rs index e7a11a9..e1f4041 100644 --- a/winapps-gui/src/main.rs +++ b/winapps-gui/src/main.rs @@ -1,3 +1,5 @@ +use winapps; + fn main() { - println!("Hello, world!"); + println!("Test lib: {}", winapps::add(1, 2)); } diff --git a/winapps/src/lib.rs b/winapps/src/lib.rs index 7d12d9a..211bfff 100644 --- a/winapps/src/lib.rs +++ b/winapps/src/lib.rs @@ -1,14 +1,3 @@ pub fn add(left: usize, right: usize) -> usize { left + right } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -}