mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 07:05:47 +02:00
Clippy fixes from stable and nightly (#13455)
- **Doccomment style fixes** - **Forgotten stuff in `nu-pretty-hex`** - **Don't `for` around an `Option`** - and more I think the suggestions here are a net positive, some of the suggestions moved into #13498 feel somewhat arbitrary, I also raised https://github.com/rust-lang/rust-clippy/issues/13188 as the nightly `byte_char_slices` would require either a global allow or otherwise a ton of granular allows or possibly confusing bytestring literals.
This commit is contained in:
committed by
GitHub
parent
928c57db41
commit
42531e017c
@ -150,13 +150,9 @@ fn fill(
|
||||
FillAlignment::Left
|
||||
};
|
||||
|
||||
let width = if let Some(arg) = width_arg { arg } else { 1 };
|
||||
let width = width_arg.unwrap_or(1);
|
||||
|
||||
let character = if let Some(arg) = character_arg {
|
||||
arg
|
||||
} else {
|
||||
" ".to_string()
|
||||
};
|
||||
let character = character_arg.unwrap_or_else(|| " ".to_string());
|
||||
|
||||
let arg = Arguments {
|
||||
width,
|
||||
|
@ -141,17 +141,17 @@ pub fn request_add_authorization_header(
|
||||
let login = match (user, password) {
|
||||
(Some(user), Some(password)) => {
|
||||
let mut enc_str = String::new();
|
||||
base64_engine.encode_string(&format!("{user}:{password}"), &mut enc_str);
|
||||
base64_engine.encode_string(format!("{user}:{password}"), &mut enc_str);
|
||||
Some(enc_str)
|
||||
}
|
||||
(Some(user), _) => {
|
||||
let mut enc_str = String::new();
|
||||
base64_engine.encode_string(&format!("{user}:"), &mut enc_str);
|
||||
base64_engine.encode_string(format!("{user}:"), &mut enc_str);
|
||||
Some(enc_str)
|
||||
}
|
||||
(_, Some(password)) => {
|
||||
let mut enc_str = String::new();
|
||||
base64_engine.encode_string(&format!(":{password}"), &mut enc_str);
|
||||
base64_engine.encode_string(format!(":{password}"), &mut enc_str);
|
||||
Some(enc_str)
|
||||
}
|
||||
_ => None,
|
||||
|
Reference in New Issue
Block a user