pub fn calculate_padding(notes: &[(usize, String)]) -> usize {
    let mut max = 0;
    let mut len = 0;

    for note in notes.iter() {
        let nl = note.0.to_string().len();

        if len == 0 {
            len = nl;
            continue;
        } else if nl > len {
            len = nl;
            max = nl;
        }
    }

    max
}
// Calculates if some padding
// must be given between note numbers
// and note text. So all notes look aligned
// Returns the difference and the max length
Calculates if some padding
must be given between note numbers
and note text. So all notes look aligned
Returns the difference and the max length
Calculates if some padding must be given between note numbers and note text . So all notes look aligned Returns the difference and the max length
pub fn calculate_padding(notes: &[(usize, String)]) -> usize {
    let mut max = 0;
    let mut len = 0;
    for note in notes.iter() {
        let nl = note.0.to_string().len();
        if len == 0 {
            len = nl;
            continue;
        } else if nl > len {
            len = nl;
            max = nl;
        }
    }
    max
}
pub fn calculate_padding ( notes : & [ ( usize , String ) ] ) -> usize { let mut max = 0 ; let mut len = 0 ; for note in notes . iter ( ) { let nl = note . 0 . to_string ( ) . len ( ) ; if len == 0 { len = nl ; continue ; } else if nl > len { len = nl ; max = nl ; } } max }
Calculates if some padding
must be given between note numbers
and note text.
Calculates if some padding must be given between note numbers and note text .
notes
&[(usize, String)]