29 lines
441 B
Plaintext
29 lines
441 B
Plaintext
import std::print;
|
|
import std::from_str;
|
|
import std::String;
|
|
|
|
struct Otus {
|
|
field: u32,
|
|
}
|
|
|
|
impl Otus {
|
|
fn test(&self) -> u32 {
|
|
*self.field
|
|
}
|
|
}
|
|
|
|
impl i32 {
|
|
fn test(&self) -> u32 {
|
|
43
|
|
}
|
|
}
|
|
|
|
fn main() -> u32 {
|
|
let otus = Otus { field: 17 };
|
|
let num = 54;
|
|
print(from_str("otus: ") + Otus::test(&otus) as u64);
|
|
print(from_str("i32: ") + i32::test(&num) as u64);
|
|
|
|
return Otus::test(&otus);
|
|
}
|