[][src]Function slash_formatter::delete_end_file_separator_mut

pub fn delete_end_file_separator_mut(s: &mut String)

Delete an ending FILE_SEPARATOR in a string except for the FILE_SEPARATOR.

extern crate slash_formatter;

let mut s = if cfg!(windows) {
    String::from(r"path\")
} else {
    String::from("path/")
};

slash_formatter::delete_end_file_separator_mut(&mut s);

assert_eq!("path", s);