summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2023-07-29 20:27:13 -0400
committerBotahamec <botahamec@outlook.com>2023-07-29 20:27:13 -0400
commit2047a3fca92b5047c5b9caf2b38049489f824447 (patch)
tree891c5300c199918acadee3c42186831bbbd517bd
Initial commit
-rw-r--r--.gitignore2
-rw-r--r--Cargo.toml8
-rw-r--r--rustfmt.toml3
-rw-r--r--src/lib.rs14
4 files changed, 27 insertions, 0 deletions
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..2377439
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "snob"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 100644
index 0000000..751a0aa
--- /dev/null
+++ b/rustfmt.toml
@@ -0,0 +1,3 @@
+edition = "2021"
+hard_tabs = true
+newline_style = "Unix"
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);
+ }
+}