Skip to content

Commit

Permalink
Clippy and format
Browse files Browse the repository at this point in the history
  • Loading branch information
direc85 committed Jun 24, 2024
1 parent d56bc59 commit cf39214
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions libsignal-service-hyper/src/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ impl From<TungsteniteWebSocketError> for ServiceError {
// }

// Process the WebSocket, until it times out.
async fn process<S: Stream>(
async fn process<S>(
socket_stream: S,
mut incoming_sink: Sender<WebSocketStreamItem>,
) -> Result<(), TungsteniteWebSocketError>
where
S: Unpin,
S: Stream + Unpin,
S: Stream<Item = Result<Message, TungsteniteError>>,
{
let mut socket_stream = socket_stream.fuse();
Expand Down
23 changes: 15 additions & 8 deletions libsignal-service/src/configuration.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use std::{collections::HashMap, str::FromStr};
use std::{
collections::HashMap,
fmt::{Display, Error, Formatter},
str::FromStr,
};

use crate::utils::BASE64_RELAXED;
use base64::prelude::*;
Expand Down Expand Up @@ -96,13 +100,16 @@ impl FromStr for SignalServers {
}
}

impl ToString for SignalServers {
fn to_string(&self) -> String {
match self {
Self::Staging => "staging",
Self::Production => "production",
}
.to_string()
impl Display for SignalServers {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> {
write!(
f,
"{}",
match self {
Self::Staging => "staging",
Self::Production => "production",
}
)
}
}

Expand Down

0 comments on commit cf39214

Please sign in to comment.