]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
rust: add proto1, which has nothing interesting as of now riir
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Thu, 2 Jan 2025 13:06:01 +0000 (18:36 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Thu, 2 Jan 2025 13:06:01 +0000 (18:36 +0530)
rust/Cargo.toml
rust/proto1/Cargo.toml [new file with mode: 0644]
rust/proto1/src/lib.rs [new file with mode: 0644]

index 1f226d406c0fa0b77e2f0250d9bdf2b0fedcef38..08ffbb48dfc48b32a75536b0955c8c4b3daa3bac 100644 (file)
@@ -1,3 +1,3 @@
 [workspace]
 resolver = "2"
-members = [ "discovery" , "property"]
+members = [ "discovery" , "property", "proto1"]
diff --git a/rust/proto1/Cargo.toml b/rust/proto1/Cargo.toml
new file mode 100644 (file)
index 0000000..4bb2ba7
--- /dev/null
@@ -0,0 +1,6 @@
+[package]
+name = "proto1"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies]
diff --git a/rust/proto1/src/lib.rs b/rust/proto1/src/lib.rs
new file mode 100644 (file)
index 0000000..b93cf3f
--- /dev/null
@@ -0,0 +1,14 @@
+pub fn add(left: u64, right: u64) -> u64 {
+    left + right
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn it_works() {
+        let result = add(2, 2);
+        assert_eq!(result, 4);
+    }
+}