summaryrefslogtreecommitdiff
path: root/semiring
diff options
context:
space:
mode:
Diffstat (limited to 'semiring')
-rw-r--r--semiring/Cargo.toml8
-rw-r--r--semiring/src/lib.rs14
2 files changed, 22 insertions, 0 deletions
diff --git a/semiring/Cargo.toml b/semiring/Cargo.toml
new file mode 100644
index 0000000..0a82e32
--- /dev/null
+++ b/semiring/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "semiring"
+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/semiring/src/lib.rs b/semiring/src/lib.rs
new file mode 100644
index 0000000..7d12d9a
--- /dev/null
+++ b/semiring/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);
+ }
+}