Use (import) a name higher up in the hierarchy


There is also an option to include only part of the path in the use statement. In this case we will have to use the rest of the path in the code, but it will allow us to use multiple name (both PI and E in this case) using the shorter name.


examples/libraries/std-pi-partial-use/src/main.rs
use std::f32::consts::PI;
use std::f64::consts;

fn main() {
    println!("{}", PI);
    println!("{}", consts::PI);
    println!("{}", consts::E);
}

3.1415927
3.141592653589793
2.718281828459045