nom-tutorial icon indicating copy to clipboard operation
nom-tutorial copied to clipboard

Remove fully qualified standard types

Open ElectricCoffee opened this issue 4 years ago • 0 comments

This issue is simply suggesting to remove the fully qualified types when dealing with things already imported by default.

This

#[derive(Clone, Default, Debug)]
pub struct Mount {
	pub device: std::string::String,
	pub mount_point: std::string::String,
	pub file_system_type: std::string::String,
	pub options: std::vec::Vec<std::string::String>,
}

could be written as this

#[derive(Clone, Default, Debug)]
pub struct Mount {
	pub device: String,
	pub mount_point: String,
	pub file_system_type: String,
	pub options: Vec<String>,
}

which is cleaner, more readable, better expresses the intent, and works out of the box in standard Rust.

ElectricCoffee avatar May 25 '20 22:05 ElectricCoffee