Skip to content

Commit 79869f9

Browse files
authored
chore: upgrade toolchain to 1.89.0 and migrate to Rust edition 2024 (#1153)
- Bump pinned toolchain from 1.88.0 to 1.89.0 in rust-toolchain.toml - Migrate all workspace crates from edition 2021 to edition 2024 - Run `cargo fix --edition` to auto-migrate source code for edition 2024 compatibility (unsafe in unsafe fn, tail expr drop order, etc.) - Replace all `expr_2021` macro fragment specifiers with `expr` now that the workspace is fully on edition 2024 - Remove `keyword_idents_2024` lint (now enforced by the edition itself) - Remove removed `clippy::string_to_string` lint (covered by implicit_clone) - Fix new clippy lints from 1.93.0: `manual_is_multiple_of`, `useless_let_if_seq`, `manual_map`, `derivable_impls`, `redundant_imports`, `unused_crate_dependencies` (but didn’t bump MSRV) - Drop `core::future::Future` unnecessary qualifications (Future is now in the Rust 2024 prelude) - Remove direct `bytes` deps from ironrdp-futures and ironrdp-tokio (re-exported by ironrdp-async)
1 parent 02b9f4e commit 79869f9

File tree

253 files changed

+895
-817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+895
-817
lines changed

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ Do not modify them unless specifically working on fixing their compilation.
127127

128128
## Coding Standards (The "Gold Standard")
129129

130-
- **Language:** Rust (Edition 2021; toolchain pinned via `rust-toolchain.toml`)
131-
- **Toolchain baseline:** Rust `1.88.0`
130+
- **Language:** Rust (Edition 2024; toolchain pinned via `rust-toolchain.toml`)
131+
- **Toolchain baseline:** Rust `1.89.0`
132132
- **Formatter:** `rustfmt` (workspace config in `rustfmt.toml`)
133133
- **Lints:** Strict workspace lint policy (`[workspace.lints.rust]` and `[workspace.lints.clippy]` in root `Cargo.toml`)
134134
- **Error handling:** Prefer explicit, composable error messages following `STYLE.md`

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exclude = [
1515
]
1616

1717
[workspace.package]
18-
edition = "2021"
18+
edition = "2024"
1919
license = "MIT OR Apache-2.0"
2020
homepage = "https://github.com/Devolutions/IronRDP"
2121
repository = "https://github.com/Devolutions/IronRDP"
@@ -53,7 +53,6 @@ unsafe_attr_outside_unsafe = "warn"
5353

5454
# == Correctness == #
5555
ambiguous_negative_literals = "warn"
56-
keyword_idents_2024 = "warn" # FIXME: remove when switched to 2024 edition
5756

5857
# == Style, readability == #
5958
elided_lifetimes_in_paths = "warn" # https://quinedot.github.io/rust-learning/dont-hide.html
@@ -134,7 +133,6 @@ checked_conversions = "warn"
134133
get_unwrap = "warn"
135134
similar_names = "warn" # Reduce risk of confusing similar names together, and protects against typos when variable shadowing was intended.
136135
str_to_string = "warn"
137-
string_to_string = "warn"
138136
std_instead_of_core = "warn"
139137
separated_literal_suffix = "warn"
140138
unused_self = "warn"

benches/src/perfenc.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ impl RdpServerDisplayUpdates for DisplayUpdates {
157157

158158
fn setup_logging() -> anyhow::Result<()> {
159159
use tracing::metadata::LevelFilter;
160-
use tracing_subscriber::prelude::*;
161160
use tracing_subscriber::EnvFilter;
161+
use tracing_subscriber::prelude::*;
162162

163163
let fmt_layer = tracing_subscriber::fmt::layer().compact();
164164

@@ -176,7 +176,9 @@ fn setup_logging() -> anyhow::Result<()> {
176176
Ok(())
177177
}
178178

179+
#[derive(Default)]
179180
enum OptCodec {
181+
#[default]
180182
RemoteFX,
181183
Bitmap,
182184
None,
@@ -186,12 +188,6 @@ enum OptCodec {
186188
QoiZ,
187189
}
188190

189-
impl Default for OptCodec {
190-
fn default() -> Self {
191-
Self::RemoteFX
192-
}
193-
}
194-
195191
impl core::str::FromStr for OptCodec {
196192
type Err = anyhow::Error;
197193

crates/iron-remote-desktop/src/extension.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use wasm_bindgen::prelude::wasm_bindgen;
21
use wasm_bindgen::JsValue;
2+
use wasm_bindgen::prelude::wasm_bindgen;
33

44
#[macro_export]
55
macro_rules! extension_match {

crates/iron-remote-desktop/src/session.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use wasm_bindgen::JsValue;
2-
use web_sys::{js_sys, HtmlCanvasElement};
2+
use web_sys::{HtmlCanvasElement, js_sys};
33

44
use crate::clipboard::ClipboardData;
55
use crate::error::IronError;
@@ -64,7 +64,7 @@ pub trait Session {
6464
type ClipboardData: ClipboardData;
6565
type Error: IronError;
6666

67-
fn run(&self) -> impl core::future::Future<Output = Result<Self::SessionTerminationInfo, Self::Error>>;
67+
fn run(&self) -> impl Future<Output = Result<Self::SessionTerminationInfo, Self::Error>>;
6868

6969
fn desktop_size(&self) -> DesktopSize;
7070

@@ -82,10 +82,7 @@ pub trait Session {
8282

8383
fn shutdown(&self) -> Result<(), Self::Error>;
8484

85-
fn on_clipboard_paste(
86-
&self,
87-
content: &Self::ClipboardData,
88-
) -> impl core::future::Future<Output = Result<(), Self::Error>>;
85+
fn on_clipboard_paste(&self, content: &Self::ClipboardData) -> impl Future<Output = Result<(), Self::Error>>;
8986

9087
fn resize(
9188
&self,

crates/ironrdp-acceptor/src/channel_connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::collections::HashSet;
22

33
use ironrdp_connector::{
4-
reason_err, ConnectorError, ConnectorErrorExt as _, ConnectorResult, Sequence, State, Written,
4+
ConnectorError, ConnectorErrorExt as _, ConnectorResult, Sequence, State, Written, reason_err,
55
};
66
use ironrdp_core::WriteBuf;
77
use ironrdp_pdu::mcs;

crates/ironrdp-acceptor/src/connection.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use core::mem;
22

33
use ironrdp_connector::{
4-
encode_x224_packet, general_err, reason_err, ConnectorError, ConnectorErrorExt as _, ConnectorResult, DesktopSize,
5-
Sequence, State, Written,
4+
ConnectorError, ConnectorErrorExt as _, ConnectorResult, DesktopSize, Sequence, State, Written, encode_x224_packet,
5+
general_err, reason_err,
66
};
7-
use ironrdp_core::{decode, WriteBuf};
7+
use ironrdp_core::{WriteBuf, decode};
88
use ironrdp_pdu as pdu;
99
use ironrdp_pdu::nego::SecurityProtocol;
1010
use ironrdp_pdu::x224::X224;
@@ -715,7 +715,7 @@ impl Sequence for Acceptor {
715715
}
716716

717717
mcs::McsMessage::DisconnectProviderUltimatum(ultimatum) => {
718-
return Err(reason_err!("received disconnect ultimatum", "{:?}", ultimatum.reason))
718+
return Err(reason_err!("received disconnect ultimatum", "{:?}", ultimatum.reason));
719719
}
720720

721721
_ => {

crates/ironrdp-acceptor/src/credssp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ use ironrdp_connector::sspi::generator::{Generator, GeneratorState};
66
use ironrdp_connector::sspi::negotiate::ProtocolConfig;
77
use ironrdp_connector::sspi::{self, AuthIdentity, KerberosServerConfig, NegotiateConfig, NetworkRequest, Username};
88
use ironrdp_connector::{
9-
custom_err, general_err, ConnectorError, ConnectorErrorKind, ConnectorResult, ServerName, Written,
9+
ConnectorError, ConnectorErrorKind, ConnectorResult, ServerName, Written, custom_err, general_err,
1010
};
11-
use ironrdp_core::{other_err, WriteBuf};
11+
use ironrdp_core::{WriteBuf, other_err};
1212
use ironrdp_pdu::PduHint;
1313
use tracing::debug;
1414

crates/ironrdp-acceptor/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#![cfg_attr(doc, doc = include_str!("../README.md"))]
22
#![doc(html_logo_url = "https://cdnweb.devolutions.net/images/projects/devolutions/logos/devolutions-icon-shadow.svg")]
33

4-
use ironrdp_async::{single_sequence_step, Framed, FramedRead, FramedWrite, NetworkClient, StreamWrapper};
4+
use ironrdp_async::{Framed, FramedRead, FramedWrite, NetworkClient, StreamWrapper, single_sequence_step};
55
use ironrdp_connector::sspi::credssp::EarlyUserAuthResult;
66
use ironrdp_connector::sspi::{AuthIdentity, KerberosServerConfig, Username};
7-
use ironrdp_connector::{custom_err, general_err, ConnectorResult, ServerName};
7+
use ironrdp_connector::{ConnectorResult, ServerName, custom_err, general_err};
88
use ironrdp_core::WriteBuf;
99
use tracing::{debug, instrument, trace};
1010

0 commit comments

Comments
 (0)