Skip to content

Commit 48e0244

Browse files
authored
chore: update Rust toolchain to 1.88.0 (#852)
MSRV is also bumped to 1.84.
1 parent eca256a commit 48e0244

File tree

53 files changed

+122
-140
lines changed

Some content is hidden

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

53 files changed

+122
-140
lines changed

benches/src/perfenc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async fn main() -> Result<(), anyhow::Error> {
4141
let filename: String = args.free_from_str().context("missing RGBX input filename")?;
4242
let file = File::open(&filename)
4343
.await
44-
.with_context(|| format!("Failed to open file: {}", filename))?;
44+
.with_context(|| format!("Failed to open file: {filename}"))?;
4545

4646
let mut flags = CmdFlags::all();
4747
let mut update_codecs = UpdateEncoderCodecs::new();
@@ -83,8 +83,8 @@ async fn main() -> Result<(), anyhow::Error> {
8383

8484
let ratio = total_enc as f64 / total_raw as f64;
8585
let percent = 100.0 - ratio * 100.0;
86-
println!("Encoder: {:?}", encoder);
87-
println!("Nb updates: {:?}", n_updates);
86+
println!("Encoder: {encoder:?}");
87+
println!("Nb updates: {n_updates:?}");
8888
println!(
8989
"Sum of bytes: {}/{} ({:.2}%)",
9090
bytesize::ByteSize(total_enc),

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
msrv = "1.75"
1+
msrv = "1.84"
22
semicolon-outside-block-ignore-multiline = true
33
accept-comment-above-statement = true
44
accept-comment-above-attributes = true

crates/ironrdp-async/src/framed.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ where
152152
return Err(io::Error::new(io::ErrorKind::UnexpectedEof, "not enough bytes"));
153153
}
154154
}
155-
Err(e) => return Err(io::Error::new(io::ErrorKind::Other, e)),
155+
Err(e) => return Err(io::Error::other(e)),
156156
};
157157
}
158158
}
@@ -167,10 +167,7 @@ where
167167
/// Data may have been read, but it will be stored in the internal buffer.
168168
pub async fn read_by_hint(&mut self, hint: &dyn PduHint) -> io::Result<Bytes> {
169169
loop {
170-
match hint
171-
.find_size(self.peek())
172-
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?
173-
{
170+
match hint.find_size(self.peek()).map_err(io::Error::other)? {
174171
Some((matched, length)) => {
175172
let bytes = self.read_exact(length).await?.freeze();
176173
if matched {

crates/ironrdp-bench/benches/bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::num::NonZero;
1+
use core::num::NonZero;
22

33
use criterion::{criterion_group, criterion_main, Criterion};
44
use ironrdp_graphics::color_conversion::to_64x64_ycbcr_tile;

crates/ironrdp-blocking/src/framed.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,15 @@ where
8181
return Err(io::Error::new(io::ErrorKind::UnexpectedEof, "not enough bytes"));
8282
}
8383
}
84-
Err(e) => return Err(io::Error::new(io::ErrorKind::Other, e)),
84+
Err(e) => return Err(io::Error::other(e)),
8585
};
8686
}
8787
}
8888

8989
/// Reads a frame using the provided PduHint.
9090
pub fn read_by_hint(&mut self, hint: &dyn PduHint) -> io::Result<Bytes> {
9191
loop {
92-
match hint
93-
.find_size(self.peek())
94-
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?
95-
{
92+
match hint.find_size(self.peek()).map_err(io::Error::other)? {
9693
Some((matched, length)) => {
9794
let bytes = self.read_exact(length)?.freeze();
9895
if matched {

crates/ironrdp-client/src/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ impl Destination {
8585
let addr = addr.into();
8686

8787
if let Some(idx) = addr.rfind(':') {
88-
if let Ok(sock_addr) = addr.parse::<std::net::SocketAddr>() {
88+
if let Ok(sock_addr) = addr.parse::<core::net::SocketAddr>() {
8989
Ok(Self {
9090
name: sock_addr.ip().to_string(),
9191
port: sock_addr.port(),
9292
})
93-
} else if addr.parse::<std::net::Ipv6Addr>().is_ok() {
93+
} else if addr.parse::<core::net::Ipv6Addr>().is_ok() {
9494
Ok(Self {
9595
name: addr,
9696
port: RDP_DEFAULT_PORT,
@@ -314,7 +314,7 @@ impl Config {
314314
let codecs = match client_codecs_capabilities(&codecs) {
315315
Ok(codecs) => codecs,
316316
Err(help) => {
317-
print!("{}", help);
317+
print!("{help}");
318318
std::process::exit(0);
319319
}
320320
};

crates/ironrdp-cliprdr-format/src/html.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ pub fn plain_html_to_cf_html(fragment: &str) -> String {
128128

129129
let end_html_pos = buffer.len();
130130

131-
let start_html_pos_value = format!("{:0>10}", start_html_pos);
132-
let end_html_pos_value = format!("{:0>10}", end_html_pos);
133-
let start_fragment_pos_value = format!("{:0>10}", start_fragment_pos);
134-
let end_fragment_pos_value = format!("{:0>10}", end_fragment_pos);
131+
let start_html_pos_value = format!("{start_html_pos:0>10}");
132+
let end_html_pos_value = format!("{end_html_pos:0>10}");
133+
let start_fragment_pos_value = format!("{start_fragment_pos:0>10}");
134+
let end_fragment_pos_value = format!("{end_fragment_pos:0>10}");
135135

136136
let mut replace_placeholder = |value_begin_idx: usize, header_value: &str| {
137137
// We know that: value_begin_idx + POS_PLACEHOLDER.len() < usize::MAX

crates/ironrdp-cliprdr/src/backend.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use crate::pdu::{
77
FormatDataRequest, FormatDataResponse, LockDataId, OwnedFormatDataResponse,
88
};
99

10-
pub trait ClipboardError: std::error::Error + Send + Sync + 'static {}
10+
pub trait ClipboardError: core::error::Error + Send + Sync + 'static {}
1111

12-
impl<T> ClipboardError for T where T: std::error::Error + Send + Sync + 'static {}
12+
impl<T> ClipboardError for T where T: core::error::Error + Send + Sync + 'static {}
1313

1414
/// Message sent by the OS clipboard backend event loop.
1515
#[derive(Debug)]

crates/ironrdp-connector/src/connection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use core::mem;
2+
use core::net::SocketAddr;
23
use std::borrow::Cow;
3-
use std::net::SocketAddr;
44
use std::sync::Arc;
55

66
use ironrdp_core::{decode, encode_vec, Encode, WriteBuf};
@@ -615,7 +615,7 @@ fn create_gcc_blocks<'a>(
615615
16 => SupportedColorDepths::BPP16,
616616
24 => SupportedColorDepths::BPP24,
617617
32 => SupportedColorDepths::BPP32 | SupportedColorDepths::BPP16,
618-
_ => panic!("Unsupported color depth: {}", max_color_depth),
618+
_ => panic!("Unsupported color depth: {max_color_depth}"),
619619
};
620620

621621
let channels = static_channels

crates/ironrdp-connector/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ impl fmt::Display for ConnectorErrorKind {
292292
}
293293
}
294294

295-
impl std::error::Error for ConnectorErrorKind {
296-
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
295+
impl core::error::Error for ConnectorErrorKind {
296+
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
297297
match &self {
298298
ConnectorErrorKind::Encode(e) => Some(e),
299299
ConnectorErrorKind::Decode(e) => Some(e),
@@ -315,7 +315,7 @@ pub trait ConnectorErrorExt {
315315
fn reason(context: &'static str, reason: impl Into<String>) -> Self;
316316
fn custom<E>(context: &'static str, e: E) -> Self
317317
where
318-
E: std::error::Error + Sync + Send + 'static;
318+
E: core::error::Error + Sync + Send + 'static;
319319
}
320320

321321
impl ConnectorErrorExt for ConnectorError {
@@ -337,7 +337,7 @@ impl ConnectorErrorExt for ConnectorError {
337337

338338
fn custom<E>(context: &'static str, e: E) -> Self
339339
where
340-
E: std::error::Error + Sync + Send + 'static,
340+
E: core::error::Error + Sync + Send + 'static,
341341
{
342342
Self::new(context, ConnectorErrorKind::Custom).with_source(e)
343343
}
@@ -349,7 +349,7 @@ pub trait ConnectorResultExt {
349349
#[must_use]
350350
fn with_source<E>(self, source: E) -> Self
351351
where
352-
E: std::error::Error + Sync + Send + 'static;
352+
E: core::error::Error + Sync + Send + 'static;
353353
}
354354

355355
impl<T> ConnectorResultExt for ConnectorResult<T> {
@@ -362,7 +362,7 @@ impl<T> ConnectorResultExt for ConnectorResult<T> {
362362

363363
fn with_source<E>(self, source: E) -> Self
364364
where
365-
E: std::error::Error + Sync + Send + 'static,
365+
E: core::error::Error + Sync + Send + 'static,
366366
{
367367
self.map_err(|e| e.with_source(source))
368368
}

0 commit comments

Comments
 (0)