1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01:00

chore: address clippy lints

This commit is contained in:
Rob Ede 2024-06-05 04:56:46 +01:00
parent e0ae11ab86
commit 3e621db606
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
4 changed files with 4 additions and 3 deletions

View File

@ -168,6 +168,7 @@ impl QueryRoot {
}
}
#[allow(clippy::duplicated_attributes)] // false positive
#[derive(Interface)]
#[graphql(
field(name = "id", ty = "&str"),

View File

@ -150,7 +150,7 @@ impl StreamHandler<Result<ws::Message, ws::ProtocolError>> for WsChatSession {
}
"/join" => {
if v.len() == 2 {
self.room = v[1].to_owned();
v[1].clone_into(&mut self.room);
self.addr.do_send(server::Join {
id: self.id,
name: self.room.clone(),

View File

@ -103,7 +103,7 @@ impl StreamHandler<Result<ChatRequest, io::Error>> for ChatSession {
}
Ok(ChatRequest::Join(name)) => {
println!("Join to room: {name}");
self.room = name.clone();
name.clone_into(&mut self.room);
self.addr.do_send(server::Join {
id: self.id,
name: name.clone(),

View File

@ -154,7 +154,7 @@ impl StreamHandler<Result<ws::Message, ws::ProtocolError>> for WsChatSession {
}
"/join" => {
if v.len() == 2 {
self.room = v[1].to_owned();
v[1].clone_into(&mut self.room);
self.addr.do_send(server::Join {
id: self.id,
name: self.room.clone(),