The you-decide approach

This is the very minimum required to use the module_name scope:

use my_crate::module_name; 

Here, you are telling the compiler that module_name exists and that, as long as the function name exists in the symbols, it can be used. However, in order to use module_name, the function will need to be preceded by module_name. For example, to use the print_me(f32) function, which exists in module_name, you will have the following:

let some_text = module_name::print_me(10.1f32);   

The module_name:: has to be added to tell the compiler to use the module_name scope rather than the current scope of the application.

..................Content has been hidden....................

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