Skip to content

Commit

Permalink
Fix new warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed May 4, 2024
1 parent 21883fe commit c101c0e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client_listener/src/internal/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::internal::*;
use crate::*;

use sha1::{Digest, Sha1};
use std::{convert::TryInto, net::IpAddr};
use std::net::IpAddr;
use tokio::{
io::AsyncWriteExt,
net::TcpStream,
Expand Down Expand Up @@ -48,7 +48,7 @@ impl InternalConnection {
.map(|cert| {
let mut hasher = Sha1::new();
hasher.update(&cert.0);
hex::encode(hasher.finalize()).as_str().try_into().unwrap()
hex::encode(hasher.finalize()).as_str().into()
});

tls_info = Some(TlsInfo { fingerprint });
Expand Down
6 changes: 3 additions & 3 deletions sable_ircd/src/command/handlers/chathistory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ fn handle_chathistory(

send_history_for_target(
server,
&response,
response,
source,
subcommand,
&target,
target,
None,
to_ts,
limit,
Expand Down Expand Up @@ -372,7 +372,7 @@ fn send_history_entries<'a>(
backward_entries: Vec<&'a HistoryLogEntry>,
forward_entries: Vec<&'a HistoryLogEntry>,
) -> CommandResult {
if backward_entries.len() == 0 && forward_entries.len() == 0 {
if backward_entries.is_empty() && forward_entries.is_empty() {
into.send(message::Fail::new(
"CHATHISTORY",
"INVALID_TARGET",
Expand Down
2 changes: 1 addition & 1 deletion sable_network/src/sync/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ impl GossipNetwork {
local_addr.set_port(0);
let connector = TlsConnector::from(Arc::clone(&self.tls_client_config));
let conn = Self::connect(&local_addr, &peer.address).await?;
let server_name = (&peer.name.value() as &str)
let server_name = (peer.name.value() as &str)
.try_into()
.expect("Invalid server name");
let stream = connector.connect(server_name, conn).await?;
Expand Down

0 comments on commit c101c0e

Please sign in to comment.