use sanitise_file_name::sanitise;
fn main() {
- // Examples of some of the things it can do:
- // whitespace is collapsed to one space,
- // various ASCII puntuation gets replaced by underscores,
- // outer whitespace is trimmed.
- // (There are reasons for each of these things,
- // and they can all be turned off or customised with options.)
+ // Examples of some of the things it can do:
+ // whitespace is collapsed to one space,
+ // various ASCII puntuation gets replaced by underscores,
+ // outer whitespace is trimmed.
+ // (There are reasons for each of these things,
+ // and they can all be turned off or customised with options.)
assert_eq!(
- sanitise(" https://example.com/Some\tfile \u{a0} name .exe "),
- "https___example.com_Some file name.exe",
- );
+ sanitise(" https://example.com/Some\tfile \u{a0} name .exe "),
+ "https___example.com_Some file name.exe",
+ );
- // The windows_safe option leads to the addition of the underscore.
+ // The windows_safe option leads to the addition of the underscore.
assert_eq!(sanitise("aux.h"), "aux_.h");
}
```