diff options
| author | Arnaud Bailly <arnaud.bailly@iohk.io> | 2024-09-23 14:14:26 +0200 |
|---|---|---|
| committer | Arnaud Bailly <arnaud.bailly@iohk.io> | 2024-09-23 14:14:26 +0200 |
| commit | 66abe3871337139e839b693ea9e290eaa9a72516 (patch) | |
| tree | c2cd349aa7c23770577b15a68e0daec2241754c7 /rust/src/main.rs | |
| parent | bc8bf78ea324cb3eb02e3d73c0c516a028ec9215 (diff) | |
| download | lambda-nantes-66abe3871337139e839b693ea9e290eaa9a72516.tar.gz | |
Scaffolding interpret function
Diffstat (limited to 'rust/src/main.rs')
| -rw-r--r-- | rust/src/main.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/rust/src/main.rs b/rust/src/main.rs index e9759d6..e18788e 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -2,10 +2,22 @@ fn main() { println!("Hello, world!"); } +#[derive(Debug, PartialEq)] +pub enum Value { + Num(i32), +} + +pub fn interpret(arg: &str) -> Value { + Value::Num(1) +} + #[cfg(test)] mod tests { + use crate::{interpret, Value::Num}; + #[test] fn it_works() { - assert_eq!(2 + 2, 4); + let result = interpret("1"); + assert_eq!(Num(1), result); } } |
