rustlings-solutions/src/about_variables.rs

21 lines
323 B
Rust
Raw Normal View History

2018-05-06 15:27:03 +00:00
#[allow(dead_code)]
2018-05-14 16:41:58 +00:00
pub fn guess_this () -> i32 {
let one = 5;
let two = 7;
let three = 3;
let result = (one + two) / three;
return result;
2018-05-06 15:27:03 +00:00
}
mod tests {
2018-05-14 16:41:58 +00:00
use super::*;
2018-05-06 15:27:03 +00:00
2018-05-14 16:41:58 +00:00
pub fn test_complicated () {
assert_eq!(1, guess_this());
2018-05-06 15:27:03 +00:00
}
}
2018-05-14 16:41:58 +00:00
pub fn exec () {
tests::test_complicated();
}