mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Remove leading and trailing whitespaces from output file
This commit is contained in:
parent
e5d9c27af7
commit
f31437fba2
1 changed files with 1 additions and 1 deletions
|
|
@ -96,7 +96,7 @@ lazy_static::lazy_static! {
|
||||||
/// is based of the implementation of the
|
/// is based of the implementation of the
|
||||||
/// [`sanitize-filename`](https://crates.io/crates/sanitize-filename) crate.
|
/// [`sanitize-filename`](https://crates.io/crates/sanitize-filename) crate.
|
||||||
pub fn sanitize<S: AsRef<str>>(path: S, include_path_separator: bool) -> String {
|
pub fn sanitize<S: AsRef<str>>(path: S, include_path_separator: bool) -> String {
|
||||||
let path = Cow::from(path.as_ref());
|
let path = Cow::from(path.as_ref().trim());
|
||||||
|
|
||||||
let path = ILLEGAL_RE.replace_all(&path, "");
|
let path = ILLEGAL_RE.replace_all(&path, "");
|
||||||
let path = CONTROL_RE.replace_all(&path, "");
|
let path = CONTROL_RE.replace_all(&path, "");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue