// If grade returned an `Option<&Vec<String>>`,
// the internal implementation would be forced to keep a `Vec<String>` to lend out.
// By returning an owned vector instead,
// the internal implementation is free to use whatever it chooses.
If grade returned an `Option<&Vec>`,
the internal implementation would be forced to keep a `Vec` to lend out.
By returning an owned vector instead,
the internal implementation is free to use whatever it chooses.
If grade returned an ` Option<&Vec > ` the internal implementation would be forced to keep a ` Vec ` to lend out . By returning an owned vector instead the internal implementation is free to use whatever it chooses .
pub fn grade(&self, grade: u32) -> Option<Vec<String>> {
        self.grades.get(&grade).cloned().map(|mut names| {
            names.sort();
            names
        })
    }
pub fn grade ( & self , grade : u32 ) -> Option < Vec < String > > { self . grades . get ( & grade ) . cloned ( ) . map ( | mut names | { names . sort ( ) ; names } ) }
If grade returned an `Option<&Vec<String>>`,
the internal implementation would be forced to keep a `Vec<String>` to lend out.
If grade returned an ` Option<&Vec<String >> ` the internal implementation would be forced to keep a ` Vec<String > ` to lend out .
&self
grade
u32