Reduce module namespace


#1

Good morning,

I would like to know how can we reduce this :

main.rs

mod commands;

fn main()
{
	commands::Commands::sayHello();
}

commands.rs

pub mod Commands
{
	pub fn sayHello()
	{
		println!("Hello !!");
	}
}

Can’t I use something like : “Commands::sayHello()” instead of the long way “commands::Commands::sayHello()” ?

Regards


#2

Remove the pub mod Commands


#3

Thanks a lot it works