Skip to content

Commit 661e23f

Browse files
committed
refactor(*): clippy single char pattern and needless borrow lints
Signed-off-by: Ömer Talha Özdemir <omertoast@gmail.com>
1 parent 629f8b5 commit 661e23f

File tree

23 files changed

+65
-65
lines changed

23 files changed

+65
-65
lines changed

crates/ilp-node/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ fn set_app_env(env_config: &Config, app: &mut App<'_, '_>, path: &[String], dept
376376
if depth == 1 {
377377
for item in &mut app.p.opts {
378378
if let Ok(value) = env_config.get_str(&item.b.name.to_lowercase()) {
379-
item.v.env = Some((&OsStr::new(item.b.name), Some(OsString::from(value))));
379+
item.v.env = Some((OsStr::new(item.b.name), Some(OsString::from(value))));
380380
}
381381
}
382382
return;

crates/ilp-node/src/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ impl InterledgerNode {
375375
}
376376
Err(RejectBuilder {
377377
code: ErrorCode::F02_UNREACHABLE,
378-
message: &format!(
378+
message: format!(
379379
// TODO we might not want to expose the internal account ID in the error
380380
"No outgoing route for account: {} (ILP address of the Prepare packet: {})",
381381
request.to.id(),

crates/interledger-api/src/routes/accounts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ where
415415
let server_secret_clone = server_secret.clone();
416416
async move {
417417
if let Some(ref username) = default_spsp_account {
418-
let id = store.get_account_id_from_username(&username).await?;
418+
let id = store.get_account_id_from_username(username).await?;
419419

420420
// TODO this shouldn't take multiple store calls
421421
let mut accounts = store.get_accounts(vec![id]).await?;

crates/interledger-api/src/routes/node_settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ where
133133
// Convert the usernames to account IDs to set the routes in the store
134134
let mut usernames: Vec<Username> = Vec::new();
135135
for username in routes.values() {
136-
let user = match Username::from_str(&username) {
136+
let user = match Username::from_str(username) {
137137
Ok(u) => u,
138138
Err(_) => return Err(Rejection::from(ApiError::bad_request())),
139139
};

crates/interledger-btp/src/packet.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ mod tests {
568568
#[test]
569569
fn from_bytes() {
570570
assert_eq!(
571-
BtpMessage::from_bytes(&MESSAGE_1_SERIALIZED).unwrap(),
571+
BtpMessage::from_bytes(MESSAGE_1_SERIALIZED).unwrap(),
572572
*MESSAGE_1
573573
);
574574
}
@@ -597,7 +597,7 @@ mod tests {
597597
#[test]
598598
fn from_bytes() {
599599
assert_eq!(
600-
BtpResponse::from_bytes(&RESPONSE_1_SERIALIZED).unwrap(),
600+
BtpResponse::from_bytes(RESPONSE_1_SERIALIZED).unwrap(),
601601
*RESPONSE_1
602602
);
603603
}
@@ -625,7 +625,7 @@ mod tests {
625625

626626
#[test]
627627
fn from_bytes() {
628-
assert_eq!(BtpError::from_bytes(&ERROR_1_SERIALIZED).unwrap(), *ERROR_1);
628+
assert_eq!(BtpError::from_bytes(ERROR_1_SERIALIZED).unwrap(), *ERROR_1);
629629
}
630630

631631
#[test]

crates/interledger-btp/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ where
113113
let (auth, mut connection) = get_auth(Box::pin(connection)).await?;
114114
debug!("Got BTP connection for username: {}", username);
115115
let account = store
116-
.get_account_from_btp_auth(&username, &auth.token.expose_secret())
116+
.get_account_from_btp_auth(&username, auth.token.expose_secret())
117117
.map_err(move |_| warn!("BTP connection does not correspond to an account"))
118118
.await?;
119119

crates/interledger-ccp/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ where
439439
warn!("Error handling incoming Route Update request, sending a Route Control request to get updated routing table info from peer. Error was: {}", &message);
440440
let reject = RejectBuilder {
441441
code: ErrorCode::F00_BAD_REQUEST,
442-
message: &message.as_bytes(),
442+
message: message.as_bytes(),
443443
data: &[],
444444
triggered_by: Some(&self.ilp_address.read()),
445445
}

crates/interledger-http/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ where
4343
}
4444
Ok(store
4545
.get_account_from_http_auth(
46-
&path_username,
46+
path_username,
4747
&password.expose_secret()[BEARER_TOKEN_START..],
4848
)
4949
.await?)

crates/interledger-ildcp/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ where
3737
if is_ildcp_request(&request.prepare) {
3838
let from = request.from.ilp_address();
3939
let builder = IldcpResponseBuilder {
40-
ilp_address: &from,
40+
ilp_address: from,
4141
asset_code: request.from.asset_code(),
4242
asset_scale: request.from.asset_scale(),
4343
};

crates/interledger-packet/src/address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl Address {
161161
unsafe {
162162
self.0
163163
.split(|&b| b == b'.')
164-
.map(|s| str::from_utf8_unchecked(&s))
164+
.map(|s| str::from_utf8_unchecked(s))
165165
}
166166
}
167167

0 commit comments

Comments
 (0)