From: Scott Worley Date: Thu, 13 Jul 2023 16:57:34 +0000 (-0700) Subject: Begin X-Git-Url: http://git.scottworley.com/pluta-lesnura/commitdiff_plain/754e97300990e3e7d3e4bfd305f3e90b677751c2?ds=sidebyside Begin On dashes vs. underscores in crate names: The Rust Book says dashes: "$ cargo new my-project" https://doc.rust-lang.org/book/ch07-01-packages-and-crates.html Rust RFC 430 says underscores: "Crates: snake_case (but prefer single word)" https://github.com/rust-lang/rfcs/blob/master/text/0430-finalizing-naming-conventions.md Rust API Guidelines says ¯\_(ツ)_/¯: "Crates: unclear" https://rust-lang.github.io/api-guidelines/naming.html with a link to https://github.com/rust-lang/api-guidelines/issues/29 So I guess we're going with dashes. --- 754e97300990e3e7d3e4bfd305f3e90b677751c2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4fffb2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +/Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..73f846f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "pluta-lesnura" +version = "0.1.0" +edition = "2021" +authors = ["Scott Worley "] +description = "A cooperative game of AI notkilleveryoneism" +license = "AGPL-3.0" +repository = "https://git.scottworley.com/pluta-lesnura" + + +[dependencies] diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,14 @@ +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); + } +}