Skip to content

Commit 069120b

Browse files
authored
Merge pull request #89 from chainbound/nico/chore/maintenance
chore: update crates, workspace edition 2024, MSRV, fmt
2 parents e9d5224 + 22a5663 commit 069120b

36 files changed

+686
-471
lines changed

Cargo.lock

Lines changed: 593 additions & 399 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,28 @@ resolver = "2"
1111

1212
[workspace.package]
1313
version = "0.1.3"
14-
edition = "2021"
15-
rust-version = "1.75"
14+
edition = "2024"
15+
rust-version = "1.85"
1616
license = "MIT"
1717
description = "A flexible and lightweight messaging library for distributed systems"
1818
authors = ["Jonas Bostoen", "Nicolas Racchi"]
1919
homepage = "https://github.com/chainbound/msg-rs"
2020
repository = "https://github.com/chainbound/msg-rs"
21-
keywords = ["messaging", "distributed", "systems", "networking", "quic", "quinn", "tokio", "async", "simulation", "pnet", "udp", "tcp", "socket"]
21+
keywords = [
22+
"messaging",
23+
"distributed",
24+
"systems",
25+
"networking",
26+
"quic",
27+
"quinn",
28+
"tokio",
29+
"async",
30+
"simulation",
31+
"pnet",
32+
"udp",
33+
"tcp",
34+
"socket",
35+
]
2236

2337
[workspace.dependencies]
2438
msg-wire = { path = "./msg-wire" }
@@ -70,7 +84,10 @@ codegen-units = 1
7084
opt-level = 3
7185

7286
[profile.debug-maxperf]
73-
inherits = "maxperf"
87+
inherits = "release"
88+
lto = true
89+
codegen-units = 1
90+
opt-level = 3
7491
debug = true
7592

7693
[workspace.metadata.docs.rs]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The 📖 [MSG-RS Book][book] contains detailed information on how to use the lib
5252

5353
## MSRV
5454

55-
The minimum supported Rust version is 1.75.
55+
The minimum supported Rust version is 1.85 (in accordance with Edition 2024 crates).
5656

5757
## Contributions & Bug Reports
5858

msg-common/src/channel.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ use std::{
55

66
use futures::{Sink, SinkExt, Stream};
77
use tokio::sync::mpsc::{
8-
self,
8+
self, Receiver,
99
error::{TryRecvError, TrySendError},
10-
Receiver,
1110
};
1211
use tokio_util::sync::{PollSendError, PollSender};
1312

msg-common/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::time::SystemTime;
99
use futures::future::BoxFuture;
1010

1111
mod channel;
12-
pub use channel::{channel, Channel};
12+
pub use channel::{Channel, channel};
1313

1414
mod task;
1515
pub use task::JoinMap;

msg-common/src/task.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use futures::{future::poll_fn, Future};
1+
use futures::{Future, future::poll_fn};
22
use std::{
33
collections::HashSet,
4-
task::{ready, Context, Poll},
4+
task::{Context, Poll, ready},
55
};
66
use tokio::task::{JoinError, JoinSet};
77

msg-socket/src/pub/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ use std::{
55
task::{Context, Poll},
66
};
77

8-
use futures::{stream::FuturesUnordered, Future, SinkExt, StreamExt};
8+
use futures::{Future, SinkExt, StreamExt, stream::FuturesUnordered};
99
use tokio::{sync::broadcast, task::JoinSet};
1010
use tokio_util::codec::Framed;
1111
use tracing::{debug, error, info, warn};
1212

1313
use super::{
14-
session::SubscriberSession, trie::PrefixTrie, PubError, PubMessage, PubOptions, SocketState,
14+
PubError, PubMessage, PubOptions, SocketState, session::SubscriberSession, trie::PrefixTrie,
1515
};
1616
use crate::{AuthResult, Authenticator};
1717
use msg_transport::{Address, PeerAddress, Transport};

msg-socket/src/pub/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ mod tests {
319319
sub2.subscribe("HELLO".to_string()).await.unwrap();
320320
tokio::time::sleep(Duration::from_millis(100)).await;
321321

322-
let original_msg = Bytes::from("WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOORLD");
322+
let original_msg = Bytes::from(
323+
"WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOORLD",
324+
);
323325

324326
pub_socket.publish("HELLO".to_string(), original_msg.clone()).await.unwrap();
325327

msg-socket/src/pub/session.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use tokio_stream::wrappers::BroadcastStream;
1111
use tokio_util::codec::Framed;
1212
use tracing::{debug, error, trace, warn};
1313

14-
use super::{trie::PrefixTrie, PubMessage, SocketState};
14+
use super::{PubMessage, SocketState, trie::PrefixTrie};
1515
use msg_wire::pubsub;
1616

1717
/// A subscriber session. This struct represents a single subscriber session, which is a
@@ -112,7 +112,7 @@ enum ControlMsg<'a> {
112112
/// Converts the message to a control message. If the message is not a control message,
113113
/// the session is closed.
114114
#[inline]
115-
fn msg_to_control(msg: &pubsub::Message) -> ControlMsg {
115+
fn msg_to_control(msg: &pubsub::Message) -> ControlMsg<'_> {
116116
if msg.payload_size() == 0 {
117117
if msg.topic().starts_with(b"MSG.SUB.") {
118118
let topic = msg.topic().strip_prefix(b"MSG.SUB.").unwrap();

msg-socket/src/pub/socket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ use std::{net::SocketAddr, path::PathBuf, sync::Arc};
33
use bytes::Bytes;
44
use futures::stream::FuturesUnordered;
55
use tokio::{
6-
net::{lookup_host, ToSocketAddrs},
6+
net::{ToSocketAddrs, lookup_host},
77
sync::broadcast,
88
task::JoinSet,
99
};
1010
use tracing::{debug, trace, warn};
1111

12-
use super::{driver::PubDriver, stats::PubStats, PubError, PubMessage, PubOptions, SocketState};
12+
use super::{PubError, PubMessage, PubOptions, SocketState, driver::PubDriver, stats::PubStats};
1313
use crate::Authenticator;
1414

1515
use msg_transport::{Address, Transport};

0 commit comments

Comments
 (0)