Skip to content
This repository was archived by the owner on Feb 22, 2026. It is now read-only.

Commit 6ced041

Browse files
authored
chore: use 2024 edition (#135)
1 parent 88a74cf commit 6ced041

13 files changed

Lines changed: 26 additions & 26 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "graphql-ws-client"
33
version = "0.11.1"
44
authors = ["Graeme Coupar <graeme@polyandglot.dev>"]
5-
edition = "2021"
5+
edition = "2024"
66
resolver = "2"
77
description = "A graphql over websockets client"
88
keywords = ["graphql", "client", "api", "websockets", "subscriptions"]

src/client/actor.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
use std::{
2-
collections::{hash_map::Entry, HashMap},
2+
collections::{HashMap, hash_map::Entry},
33
future::IntoFuture,
44
};
55

6-
use futures_lite::{future, stream, FutureExt, StreamExt};
7-
use serde_json::{json, Value};
6+
use futures_lite::{FutureExt, StreamExt, future, stream};
7+
use serde_json::{Value, json};
88

99
use crate::{
10+
Error, SubscriptionId,
1011
logging::{trace, warning},
1112
protocol::Event,
12-
Error, SubscriptionId,
1313
};
1414

1515
use super::{
16+
ConnectionCommand,
1617
connection::{Message, ObjectSafeConnection},
1718
keepalive::KeepAliveSettings,
18-
ConnectionCommand,
1919
};
2020

2121
#[must_use]
@@ -110,13 +110,13 @@ impl ConnectionActor {
110110
return Some(Message::Close {
111111
code: Some(code),
112112
reason: Some(reason),
113-
})
113+
});
114114
}
115115
Err(other) => {
116116
return Some(Message::Close {
117117
code: Some(4857),
118118
reason: Some(format!("Error while decoding event: {other}")),
119-
})
119+
});
120120
}
121121
};
122122

src/client/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ use std::{
66
use futures_lite::future;
77
use serde::Serialize;
88

9-
use crate::{graphql::GraphqlOperation, logging::trace, protocol::Event, Error};
9+
use crate::{Error, graphql::GraphqlOperation, logging::trace, protocol::Event};
1010

1111
use super::{
12+
Client, Subscription,
1213
actor::ConnectionActor,
1314
connection::{Connection, Message, ObjectSafeConnection},
1415
keepalive::KeepAliveSettings,
1516
production_future::read_from_producer,
16-
Client, Subscription,
1717
};
1818

1919
/// Builder for Graphql over Websocket clients
@@ -176,7 +176,7 @@ impl ClientBuilder {
176176
return Err(Error::Close(
177177
code.unwrap_or_default(),
178178
reason.unwrap_or_default(),
179-
))
179+
));
180180
}
181181
Some(Message::Ping | Message::Pong) => {}
182182
Some(message @ Message::Text(_)) => {

src/client/keepalive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{future::pending, time::Duration};
22

3-
use futures_lite::{stream, Stream};
3+
use futures_lite::{Stream, stream};
44

55
use crate::ConnectionCommand;
66

src/client/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
use std::{
22
fmt,
33
sync::{
4-
atomic::{AtomicUsize, Ordering},
54
Arc,
5+
atomic::{AtomicUsize, Ordering},
66
},
77
};
88

99
use futures_lite::StreamExt;
1010
use serde_json::Value;
1111

1212
use crate::{
13+
Error,
1314
graphql::GraphqlOperation,
1415
protocol::{self},
15-
Error,
1616
};
1717

1818
mod actor;

src/client/production_future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{future::Future, task::Poll};
22

3-
use futures_lite::{future, FutureExt};
3+
use futures_lite::{FutureExt, future};
44

55
/// A future that runs a long running producer future while also polling a future
66
/// that should be reading a stream generated by that producer future.

src/client/subscription.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ use std::{
33
task::{Context, Poll},
44
};
55

6-
use futures_lite::{future, stream, Stream, StreamExt};
6+
use futures_lite::{Stream, StreamExt, future, stream};
77

88
use crate::{
9-
client::production_future::read_from_producer, graphql::GraphqlOperation, Error, SubscriptionId,
9+
Error, SubscriptionId, client::production_future::read_from_producer, graphql::GraphqlOperation,
1010
};
1111

1212
use super::ConnectionCommand;

src/doc_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::future::Future;
22

3-
use crate::{client::Message, Error};
3+
use crate::{Error, client::Message};
44

55
pub struct Conn;
66

src/native.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use futures_lite::{Stream, StreamExt};
22
use futures_sink::Sink;
33
use tungstenite::{self, protocol::CloseFrame};
44

5-
use crate::{sink_ext::SinkExt, Error, Message};
5+
use crate::{Error, Message, sink_ext::SinkExt};
66

77
#[cfg_attr(docsrs, doc(cfg(feature = "tungstenite")))]
88
impl<T> crate::client::Connection for T
@@ -18,15 +18,15 @@ where
1818
loop {
1919
match self.next().await? {
2020
Ok(tungstenite::Message::Text(text)) => {
21-
return Some(crate::client::Message::Text(text))
21+
return Some(crate::client::Message::Text(text));
2222
}
2323
Ok(tungstenite::Message::Ping(_)) => return Some(crate::client::Message::Ping),
2424
Ok(tungstenite::Message::Pong(_)) => return Some(crate::client::Message::Pong),
2525
Ok(tungstenite::Message::Close(frame)) => {
2626
return Some(crate::client::Message::Close {
2727
code: frame.as_ref().map(|frame| frame.code.into()),
2828
reason: frame.map(|frame| frame.reason.to_string()),
29-
})
29+
});
3030
}
3131
Ok(tungstenite::Message::Frame(_) | tungstenite::Message::Binary(_)) => continue,
3232
Err(error) => {

src/ws_stream_wasm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use futures_lite::{FutureExt, StreamExt};
22
use pharos::{Observable, ObserveConfig};
33
use ws_stream_wasm::{WsEvent, WsMessage, WsMeta, WsStream};
44

5-
use crate::{sink_ext::SinkExt, Error};
5+
use crate::{Error, sink_ext::SinkExt};
66

77
/// A websocket connection for [ws_stream_wasm][1]
88
///

0 commit comments

Comments
 (0)