The use-glob-self approach

Here, the first parameter of the glob is self. In this context, self refers back to the root context:

use my_crate::module_name::{self, print as my_print, calculate as my_calc}; 

In an expanded form, this will equate to the following:

use my_crate::module_name; 
use my_crate::module_name::print as my_print; 
use my_crate::module_name::calculate as my_calc; 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset