summaryrefslogtreecommitdiff
path: root/add/add-one/src
diff options
context:
space:
mode:
authorAdam Carpenter <53hornet@gmail.com>2019-03-13 10:02:15 -0400
committerAdam Carpenter <53hornet@gmail.com>2019-03-13 10:02:15 -0400
commit8a4d2fb922c2c5a9e900b4b836d7787a09a1fe90 (patch)
treeafb760597bf4cc78194892be910febde0209f7f3 /add/add-one/src
parentb71e253b697bae079a0cf2526209334f4b81f9a5 (diff)
downloadlearning-rust-8a4d2fb922c2c5a9e900b4b836d7787a09a1fe90.tar.xz
learning-rust-8a4d2fb922c2c5a9e900b4b836d7787a09a1fe90.zip
Added concurrency, pointers, oop
Diffstat (limited to 'add/add-one/src')
-rw-r--r--add/add-one/src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/add/add-one/src/lib.rs b/add/add-one/src/lib.rs
new file mode 100644
index 0000000..fe3583e
--- /dev/null
+++ b/add/add-one/src/lib.rs
@@ -0,0 +1,11 @@
+pub fn add_one(x: i32) -> i32 {
+ x + 1
+}
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn it_works() {
+ assert_eq!(2 + 2, 4);
+ }
+}