How to import everything from the root of the box?

To import characters from a module, you need to either list them or use a wildcard to import everything. That is, I can use either use module::{SomeSymbol, SomeOtherSymbol};, oruse module::*;

However, when importing from the top-level module the basket root, wildcards do not work. I can use either use {SomeSymbol, SomeOtherSymbol};, or use ::{SomeSymbol, SomeOtherSymbol}};, but neither use *;, nor use ::*;work.

Why does it not work and how to import everything from the root of the box?

+4
source share
1 answer

Starting with Rust 1.14, and now working as intended (importing everything from the root of the basket) ! use *;use ::*;


Useful links:

+5

Source: https://habr.com/ru/post/1663994/


All Articles