pub fn generate_title(name: &str, class: FullClass, stage: Stage) -> String {
    let mut s = String::new();

    // Push the name, followed by a space (if the name is non-empty)
    s.push_str(name);
    if !name.is_empty() {
        s.push(' ');
    }
    // Push the classification, and add another space if the classification wasn't the empty string
    // (which we check indirectly by measuring the length of `s` before and after adding the
    // classification string)
    let len_before_class = s.len();
    class.fmt_name(&mut s, true).unwrap();
    if s.len() > len_before_class {
        // If the class made the string longer, we need another space before the stage
        s.push(' ');
    }
    // Always push the stage
    s.push_str(stage.name().expect("Stage was too big to generate a name"));

    s
}
/// Generate the (standard) title of a [`Method`] from its parts, according to the Framework's
/// rules.  Some methods (e.g. Grandsire and Union) do not follow this convention, and therefore
/// their titles must be stored separately.
Generate the (standard) title of a [`Method`] from its parts, according to the Framework's
rules.  Some methods  do not follow this convention, and therefore
their titles must be stored separately.
Generate the ( standard ) title of a [ ` Method ` ] from its parts according to the Framework ' s rules . Some methods do not follow this convention and therefore their titles must be stored separately .
pub fn generate_title(name: &str, class: FullClass, stage: Stage) -> String {
    let mut s = String::new();
    // Push the name, followed by a space (if the name is non-empty)
    s.push_str(name);
    if !name.is_empty() {
        s.push(' ');
    }
    // Push the classification, and add another space if the classification wasn't the empty string
    // (which we check indirectly by measuring the length of `s` before and after adding the
    // classification string)
    let len_before_class = s.len();
    class.fmt_name(&mut s, true).unwrap();
    if s.len() > len_before_class {
        // If the class made the string longer, we need another space before the stage
        s.push(' ');
    }
    // Always push the stage
    s.push_str(stage.name().expect("Stage was too big to generate a name"));
    s
}
pub fn generate_title ( name : & str , class : FullClass , stage : Stage ) -> String { let mut s = String :: new ( ) ; // Push the name, followed by a space (if the name is non-empty) s . push_str ( name ) ; if ! name . is_empty ( ) { s . push ( ' ' ) ; } // Push the classification, and add another space if the classification wasn't the empty string // (which we check indirectly by measuring the length of `s` before and after adding the // classification string) let len_before_class = s . len ( ) ; class . fmt_name ( & mut s , true ) . unwrap ( ) ; if s . len ( ) > len_before_class { // If the class made the string longer, we need another space before the stage s . push ( ' ' ) ; } // Always push the stage s . push_str ( stage . name ( ) . expect ( " " ) ) ; s }
Generate the (standard) title of a [`Method`] from its parts, according to the Framework's
rules.
Generate the ( standard ) title of a [ ` Method ` ] from its parts according to the Framework ' s rules .
name
&str
class
FullClass
stage
Stage
name
&str
class
FullClass
stage
Stage