Skip to content

Commit

Permalink
Fix new clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusPettersson98 committed Jan 14, 2025
1 parent 8dcbb39 commit 9649e07
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion talpid-core/src/split_tunnel/macos/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ mod test {
msg.contains('\n'),
"Message does not contain a newline!! Make sure to add a newline to '{msg}'"
);
let (stdout_read, mut stdout_write) = simplex(msg.as_bytes().len());
let (stdout_read, mut stdout_write) = simplex(msg.len());
// "print" to "stdout" after `duration`.
tokio::spawn(async move {
tokio::time::sleep(lag).await;
Expand Down
3 changes: 1 addition & 2 deletions talpid-dbus/src/systemd_resolved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ impl SystemdResolved {
let parts = contents.trim().split(' ');
parts
.map(str::parse::<IpAddr>)
.map(|maybe_ip| maybe_ip.map(|addr| addr.is_loopback()).unwrap_or(false))
.any(|is_loopback| is_loopback)
.any(|maybe_ip| maybe_ip.map(|addr| addr.is_loopback()).unwrap_or(false))
})
.unwrap_or(false);

Expand Down
4 changes: 2 additions & 2 deletions talpid-types/src/net/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ impl SocksAuth {
/// assert!(too_long_username.is_err());
/// ```
pub fn new(username: String, password: String) -> Result<Self, Error> {
if !(1..=255).contains(&password.as_bytes().len()) {
if !(1..=255).contains(&password.len()) {
return Err(Error::InvalidSocksAuthValues(
"Password length should between 1 and 255 bytes",
));
}
if !(1..=255).contains(&username.as_bytes().len()) {
if !(1..=255).contains(&username.len()) {
return Err(Error::InvalidSocksAuthValues(
"Username length should between 1 and 255 bytes",
));
Expand Down

0 comments on commit 9649e07

Please sign in to comment.