Fix clippy::needless_borrow lint violations (#36444)
Release Notes: - N/A
This commit is contained in:
@@ -155,7 +155,7 @@ fn increment_decimal_string(num: &str, delta: i64) -> String {
|
||||
}
|
||||
|
||||
fn increment_hex_string(num: &str, delta: i64) -> String {
|
||||
let result = if let Ok(val) = u64::from_str_radix(&num, 16) {
|
||||
let result = if let Ok(val) = u64::from_str_radix(num, 16) {
|
||||
val.wrapping_add_signed(delta)
|
||||
} else {
|
||||
u64::MAX
|
||||
@@ -181,7 +181,7 @@ fn should_use_lowercase(num: &str) -> bool {
|
||||
}
|
||||
|
||||
fn increment_binary_string(num: &str, delta: i64) -> String {
|
||||
let result = if let Ok(val) = u64::from_str_radix(&num, 2) {
|
||||
let result = if let Ok(val) = u64::from_str_radix(num, 2) {
|
||||
val.wrapping_add_signed(delta)
|
||||
} else {
|
||||
u64::MAX
|
||||
|
||||
@@ -549,7 +549,7 @@ mod test {
|
||||
cx.set_neovim_option("nowrap").await;
|
||||
|
||||
let content = "ˇ01234567890123456789";
|
||||
cx.set_shared_state(&content).await;
|
||||
cx.set_shared_state(content).await;
|
||||
|
||||
cx.simulate_shared_keystrokes("z shift-l").await;
|
||||
cx.shared_state().await.assert_eq("012345ˇ67890123456789");
|
||||
@@ -560,7 +560,7 @@ mod test {
|
||||
cx.shared_state().await.assert_eq("012345ˇ67890123456789");
|
||||
|
||||
let content = "ˇ01234567890123456789";
|
||||
cx.set_shared_state(&content).await;
|
||||
cx.set_shared_state(content).await;
|
||||
|
||||
cx.simulate_shared_keystrokes("z l").await;
|
||||
cx.shared_state().await.assert_eq("0ˇ1234567890123456789");
|
||||
|
||||
Reference in New Issue
Block a user