Ravago Jones | 1680980 | 2021-11-18 20:40:03 -0800 | [diff] [blame] | 1 | extern crate hello_lib; |
2 | |||||
3 | extern "C" { | ||||
4 | fn sqrt(x: f64) -> f64; | ||||
5 | } | ||||
6 | |||||
7 | fn main() { | ||||
8 | let hello = hello_lib::Greeter::new("Hello"); | ||||
9 | println!("{},\n{}", hello.greet("world"), hello.greet("bazel")); | ||||
10 | |||||
11 | let mut numbers = Vec::new(); | ||||
12 | for i in 1..=10 { | ||||
13 | numbers.push(i); | ||||
14 | } | ||||
15 | println!("{:?}", numbers); | ||||
16 | |||||
17 | let words = vec!["foo", "bar", "baz"]; | ||||
18 | println!("{:?}", words); | ||||
19 | |||||
20 | println!("sqrt(4) = {}", unsafe { sqrt(4.0) }); | ||||
21 | } |