cargo fmt; parser help

This commit is contained in:
epi
2022-01-10 20:01:10 -06:00
parent 701701eea3
commit 06460bf9da
2 changed files with 8 additions and 8 deletions

View File

@@ -731,13 +731,13 @@ impl Configuration {
"Cookie".to_string(),
// on splitting, there should be only two elements,
// a key and a value
cookies.map(|cookie| cookie.split('=').collect::<Vec<&str>>()[..].to_owned())
.filter(|parts| parts.len() == 2)
.map(|parts| format!("{}={}", parts[0].trim(), parts[1].trim()))
// trim the spaces, join with an equals sign
.collect::<Vec<String>>()
.join("; ")
// join all the cookies with semicolons for the final header
cookies
.map(|cookie| cookie.split('=').collect::<Vec<&str>>()[..].to_owned())
.filter(|parts| parts.len() == 2)
.map(|parts| format!("{}={}", parts[0].trim(), parts[1].trim()))
// trim the spaces, join with an equals sign
.collect::<Vec<String>>()
.join("; "), // join all the cookies with semicolons for the final header
);
}

View File

@@ -259,7 +259,7 @@ pub fn initialize() -> App<'static, 'static> {
.multiple(true)
.use_delimiter(true)
.help(
"Specify HTTP cookies (ex: -b Cookie=val 'stuff=things')",
"Specify HTTP cookies (ex: -b stuff=things)",
),
)
.arg(