benkay86 / nom-tutorial

Tutorial for parsing with nom 5.
288 stars 17 forks source link

Remove fully qualified standard types #7

Open ElectricCoffee opened 4 years ago

ElectricCoffee commented 4 years ago

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.