microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
compiler/qsc_codegen/src/lib.rs
20lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | #![warn(clippy::mod_module_files, clippy::pedantic, clippy::unwrap_used)] |
| 5 | |
| 6 | #[must_use] |
| 7 | pub fn add(left: usize, right: usize) -> usize { |
| 8 | left + right |
| 9 | } |
| 10 | |
| 11 | #[cfg(test)] |
| 12 | mod tests { |
| 13 | use super::*; |
| 14 | |
| 15 | #[test] |
| 16 | fn it_works() { |
| 17 | let result = add(2, 2); |
| 18 | assert_eq!(result, 4); |
| 19 | } |
| 20 | } |