Debian Codegraph @

third_party/rust/extend/tests/compile_pass/hello_world.rs

raw
1 use extend::ext;
2
3 #[ext]
4 impl i32 {
5 fn add_one(&self) -> Self {
6 self + 1
7 }
8
9 fn foo() -> MyType {
10 MyType
11 }
12 }
13
14 #[derive(Debug, Eq, PartialEq)]
15 struct MyType;
16
17 fn main() {
18 assert_eq!(i32::foo(), MyType);
19 assert_eq!(1.add_one(), 2);
20 }