diff --git a/crates/lavina-core/src/repo/mod.rs b/crates/lavina-core/src/repo/mod.rs index a1057af..49a31e8 100644 --- a/crates/lavina-core/src/repo/mod.rs +++ b/crates/lavina-core/src/repo/mod.rs @@ -59,8 +59,10 @@ impl Storage { #[tracing::instrument(skip(self), name = "Storage::check_user_existance")] pub async fn check_user_existance(&self, username: &str) -> Result { let mut executor = self.conn.lock().await; - let result: Option<(String,)> = - sqlx::query_as("select name from users where name = ?;").bind(username).fetch_optional(&mut *executor).await?; + let result: Option<(String,)> = sqlx::query_as("select name from users where name = ?;") + .bind(username) + .fetch_optional(&mut *executor) + .await?; Ok(result.is_some()) } diff --git a/crates/projection-irc/tests/lib.rs b/crates/projection-irc/tests/lib.rs index 96a679d..9b72947 100644 --- a/crates/projection-irc/tests/lib.rs +++ b/crates/projection-irc/tests/lib.rs @@ -382,7 +382,7 @@ async fn scenario_two_users() -> Result<()> { s1.expect(":tester1 PART #test").await?; // The second user should receive the PART message s2.expect(":tester1 PART #test").await?; - + s1.send("WHOIS tester2").await?; s1.expect(":testserver 318 tester1 tester2 :End of /WHOIS list").await?; @@ -391,7 +391,6 @@ async fn scenario_two_users() -> Result<()> { s2.expect(":testserver 401 tester2 tester3 :No such nick/channel").await?; s2.expect(":testserver 318 tester2 tester3 :End of /WHOIS list").await?; - stream2.shutdown().await?; server.shutdown().await?; diff --git a/crates/proto-irc/src/commands/whois/error.rs b/crates/proto-irc/src/commands/whois/error.rs index ea39d29..426095b 100644 --- a/crates/proto-irc/src/commands/whois/error.rs +++ b/crates/proto-irc/src/commands/whois/error.rs @@ -2,7 +2,6 @@ use tokio::io::{AsyncWrite, AsyncWriteExt}; use crate::{prelude::Str, response::WriteResponse}; - /// ErrNoSuchNick401 pub struct ErrNoSuchNick401 { client: Str, diff --git a/crates/proto-irc/src/commands/whois/mod.rs b/crates/proto-irc/src/commands/whois/mod.rs index 0170780..52897d3 100644 --- a/crates/proto-irc/src/commands/whois/mod.rs +++ b/crates/proto-irc/src/commands/whois/mod.rs @@ -1,2 +1,2 @@ pub mod error; -pub mod response; \ No newline at end of file +pub mod response; diff --git a/crates/proto-irc/src/lib.rs b/crates/proto-irc/src/lib.rs index 46de52b..b2c8a37 100644 --- a/crates/proto-irc/src/lib.rs +++ b/crates/proto-irc/src/lib.rs @@ -1,12 +1,12 @@ //! Client-to-Server IRC protocol. pub mod client; +pub mod commands; mod prelude; pub mod response; pub mod server; #[cfg(test)] mod testkit; pub mod user; -pub mod commands; use crate::prelude::Str;