Setup basic dependencies

This commit is contained in:
LDprg 2023-07-13 14:50:32 +02:00
parent 2b294a678b
commit 8aff1aa9a1
6 changed files with 14 additions and 13 deletions

6
.gitignore vendored Normal file
View File

@ -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

View File

@ -6,3 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
winapps = { path = "../winapps" }

View File

@ -1,3 +1,5 @@
use winapps;
fn main() { fn main() {
println!("Hello, world!"); println!("Test lib: {}", winapps::add(1, 2));
} }

View File

@ -6,3 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
winapps = { path = "../winapps" }

View File

@ -1,3 +1,5 @@
use winapps;
fn main() { fn main() {
println!("Hello, world!"); println!("Test lib: {}", winapps::add(1, 2));
} }

View File

@ -1,14 +1,3 @@
pub fn add(left: usize, right: usize) -> usize { pub fn add(left: usize, right: usize) -> usize {
left + right left + right
} }
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}