chore: update Rust toolchain to 1.88.0 (#852)

MSRV is also bumped to 1.84.
This commit is contained in:
Benoît Cortier
2025-07-03 07:38:28 +03:00
committed by GitHub
parent eca256ae10
commit 48e02441d2
53 changed files with 122 additions and 140 deletions
+3 -3
View File
@@ -41,7 +41,7 @@ async fn main() -> Result<(), anyhow::Error> {
let filename: String = args.free_from_str().context("missing RGBX input filename")?;
let file = File::open(&filename)
.await
.with_context(|| format!("Failed to open file: {}", filename))?;
.with_context(|| format!("Failed to open file: {filename}"))?;
let mut flags = CmdFlags::all();
let mut update_codecs = UpdateEncoderCodecs::new();
@@ -83,8 +83,8 @@ async fn main() -> Result<(), anyhow::Error> {
let ratio = total_enc as f64 / total_raw as f64;
let percent = 100.0 - ratio * 100.0;
println!("Encoder: {:?}", encoder);
println!("Nb updates: {:?}", n_updates);
println!("Encoder: {encoder:?}");
println!("Nb updates: {n_updates:?}");
println!(
"Sum of bytes: {}/{} ({:.2}%)",
bytesize::ByteSize(total_enc),
+1 -1
View File
@@ -1,4 +1,4 @@
msrv = "1.75"
msrv = "1.84"
semicolon-outside-block-ignore-multiline = true
accept-comment-above-statement = true
accept-comment-above-attributes = true
+2 -5
View File
@@ -152,7 +152,7 @@ where
return Err(io::Error::new(io::ErrorKind::UnexpectedEof, "not enough bytes"));
}
}
Err(e) => return Err(io::Error::new(io::ErrorKind::Other, e)),
Err(e) => return Err(io::Error::other(e)),
};
}
}
@@ -167,10 +167,7 @@ where
/// Data may have been read, but it will be stored in the internal buffer.
pub async fn read_by_hint(&mut self, hint: &dyn PduHint) -> io::Result<Bytes> {
loop {
match hint
.find_size(self.peek())
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?
{
match hint.find_size(self.peek()).map_err(io::Error::other)? {
Some((matched, length)) => {
let bytes = self.read_exact(length).await?.freeze();
if matched {
+1 -1
View File
@@ -1,4 +1,4 @@
use std::num::NonZero;
use core::num::NonZero;
use criterion::{criterion_group, criterion_main, Criterion};
use ironrdp_graphics::color_conversion::to_64x64_ycbcr_tile;
+2 -5
View File
@@ -81,7 +81,7 @@ where
return Err(io::Error::new(io::ErrorKind::UnexpectedEof, "not enough bytes"));
}
}
Err(e) => return Err(io::Error::new(io::ErrorKind::Other, e)),
Err(e) => return Err(io::Error::other(e)),
};
}
}
@@ -89,10 +89,7 @@ where
/// Reads a frame using the provided PduHint.
pub fn read_by_hint(&mut self, hint: &dyn PduHint) -> io::Result<Bytes> {
loop {
match hint
.find_size(self.peek())
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?
{
match hint.find_size(self.peek()).map_err(io::Error::other)? {
Some((matched, length)) => {
let bytes = self.read_exact(length)?.freeze();
if matched {
+3 -3
View File
@@ -85,12 +85,12 @@ impl Destination {
let addr = addr.into();
if let Some(idx) = addr.rfind(':') {
if let Ok(sock_addr) = addr.parse::<std::net::SocketAddr>() {
if let Ok(sock_addr) = addr.parse::<core::net::SocketAddr>() {
Ok(Self {
name: sock_addr.ip().to_string(),
port: sock_addr.port(),
})
} else if addr.parse::<std::net::Ipv6Addr>().is_ok() {
} else if addr.parse::<core::net::Ipv6Addr>().is_ok() {
Ok(Self {
name: addr,
port: RDP_DEFAULT_PORT,
@@ -314,7 +314,7 @@ impl Config {
let codecs = match client_codecs_capabilities(&codecs) {
Ok(codecs) => codecs,
Err(help) => {
print!("{}", help);
print!("{help}");
std::process::exit(0);
}
};
+4 -4
View File
@@ -128,10 +128,10 @@ pub fn plain_html_to_cf_html(fragment: &str) -> String {
let end_html_pos = buffer.len();
let start_html_pos_value = format!("{:0>10}", start_html_pos);
let end_html_pos_value = format!("{:0>10}", end_html_pos);
let start_fragment_pos_value = format!("{:0>10}", start_fragment_pos);
let end_fragment_pos_value = format!("{:0>10}", end_fragment_pos);
let start_html_pos_value = format!("{start_html_pos:0>10}");
let end_html_pos_value = format!("{end_html_pos:0>10}");
let start_fragment_pos_value = format!("{start_fragment_pos:0>10}");
let end_fragment_pos_value = format!("{end_fragment_pos:0>10}");
let mut replace_placeholder = |value_begin_idx: usize, header_value: &str| {
// We know that: value_begin_idx + POS_PLACEHOLDER.len() < usize::MAX
+2 -2
View File
@@ -7,9 +7,9 @@ use crate::pdu::{
FormatDataRequest, FormatDataResponse, LockDataId, OwnedFormatDataResponse,
};
pub trait ClipboardError: std::error::Error + Send + Sync + 'static {}
pub trait ClipboardError: core::error::Error + Send + Sync + 'static {}
impl<T> ClipboardError for T where T: std::error::Error + Send + Sync + 'static {}
impl<T> ClipboardError for T where T: core::error::Error + Send + Sync + 'static {}
/// Message sent by the OS clipboard backend event loop.
#[derive(Debug)]
+2 -2
View File
@@ -1,6 +1,6 @@
use core::mem;
use core::net::SocketAddr;
use std::borrow::Cow;
use std::net::SocketAddr;
use std::sync::Arc;
use ironrdp_core::{decode, encode_vec, Encode, WriteBuf};
@@ -615,7 +615,7 @@ fn create_gcc_blocks<'a>(
16 => SupportedColorDepths::BPP16,
24 => SupportedColorDepths::BPP24,
32 => SupportedColorDepths::BPP32 | SupportedColorDepths::BPP16,
_ => panic!("Unsupported color depth: {}", max_color_depth),
_ => panic!("Unsupported color depth: {max_color_depth}"),
};
let channels = static_channels
+6 -6
View File
@@ -292,8 +292,8 @@ impl fmt::Display for ConnectorErrorKind {
}
}
impl std::error::Error for ConnectorErrorKind {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
impl core::error::Error for ConnectorErrorKind {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
match &self {
ConnectorErrorKind::Encode(e) => Some(e),
ConnectorErrorKind::Decode(e) => Some(e),
@@ -315,7 +315,7 @@ pub trait ConnectorErrorExt {
fn reason(context: &'static str, reason: impl Into<String>) -> Self;
fn custom<E>(context: &'static str, e: E) -> Self
where
E: std::error::Error + Sync + Send + 'static;
E: core::error::Error + Sync + Send + 'static;
}
impl ConnectorErrorExt for ConnectorError {
@@ -337,7 +337,7 @@ impl ConnectorErrorExt for ConnectorError {
fn custom<E>(context: &'static str, e: E) -> Self
where
E: std::error::Error + Sync + Send + 'static,
E: core::error::Error + Sync + Send + 'static,
{
Self::new(context, ConnectorErrorKind::Custom).with_source(e)
}
@@ -349,7 +349,7 @@ pub trait ConnectorResultExt {
#[must_use]
fn with_source<E>(self, source: E) -> Self
where
E: std::error::Error + Sync + Send + 'static;
E: core::error::Error + Sync + Send + 'static;
}
impl<T> ConnectorResultExt for ConnectorResult<T> {
@@ -362,7 +362,7 @@ impl<T> ConnectorResultExt for ConnectorResult<T> {
fn with_source<E>(self, source: E) -> Self
where
E: std::error::Error + Sync + Send + 'static,
E: core::error::Error + Sync + Send + 'static,
{
self.map_err(|e| e.with_source(source))
}
+2 -2
View File
@@ -35,10 +35,10 @@ impl From<&str> for ServerName {
fn sanitize_server_name(name: String) -> String {
if let Some(idx) = name.rfind(':') {
if let Ok(sock_addr) = name.parse::<std::net::SocketAddr>() {
if let Ok(sock_addr) = name.parse::<core::net::SocketAddr>() {
// A socket address, including a port
sock_addr.ip().to_string()
} else if name.parse::<std::net::Ipv6Addr>().is_ok() {
} else if name.parse::<core::net::Ipv6Addr>().is_ok() {
// An IPv6 address with no port, do not include a port, already sane
name
} else {
+1 -1
View File
@@ -34,7 +34,7 @@ impl fmt::Display for NotEnoughBytesError {
}
#[cfg(feature = "std")]
impl std::error::Error for NotEnoughBytesError {}
impl core::error::Error for NotEnoughBytesError {}
macro_rules! ensure_enough_bytes {
(in: $buf:ident, size: $expected:expr) => {{
+1 -1
View File
@@ -64,7 +64,7 @@ pub enum DecodeErrorKind {
}
#[cfg(feature = "std")]
impl std::error::Error for DecodeErrorKind {}
impl core::error::Error for DecodeErrorKind {}
impl fmt::Display for DecodeErrorKind {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+1 -1
View File
@@ -68,7 +68,7 @@ pub enum EncodeErrorKind {
}
#[cfg(feature = "std")]
impl std::error::Error for EncodeErrorKind {}
impl core::error::Error for EncodeErrorKind {}
impl fmt::Display for EncodeErrorKind {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -21,7 +21,7 @@ impl core::fmt::Display for WindowsError {
WindowsError::CreateNamedPipe(_) => write!(f, "failed to create named pipe"),
WindowsError::CreateEvent(_) => write!(f, "failed to create event object"),
WindowsError::SetEvent(_) => write!(f, "failed to set event to signaled state"),
WindowsError::InvalidSemaphoreParams(cause) => write!(f, "invalid semaphore parameters: {}", cause),
WindowsError::InvalidSemaphoreParams(cause) => write!(f, "invalid semaphore parameters: {cause}"),
WindowsError::ReleaseSemaphore(_) => write!(f, "failed to release semaphore"),
WindowsError::WaitForMultipleObjectsFailed(_) => write!(f, "failed to wait for multiple objects"),
WindowsError::WaitForMultipleObjectsTimeout => write!(f, "timed out waiting for multiple objects"),
@@ -32,7 +32,7 @@ impl core::fmt::Display for WindowsError {
WindowsError::OverlappedRead(_) => write!(f, "overlapped read failed"),
WindowsError::OverlappedWrite(_) => write!(f, "overlapped write failed"),
WindowsError::CreateSemaphore(_) => write!(f, "failed to create semaphore object"),
WindowsError::InvalidPipeName(cause) => write!(f, "invalid pipe name: `{}`", cause),
WindowsError::InvalidPipeName(cause) => write!(f, "invalid pipe name: `{cause}`"),
}
}
}
+1 -1
View File
@@ -272,7 +272,7 @@ impl fmt::Display for Cmd {
impl From<Cmd> for String {
fn from(cmd: Cmd) -> Self {
format!("{:?}", cmd)
format!("{cmd:?}")
}
}
+10 -10
View File
@@ -9,10 +9,10 @@ use alloc::boxed::Box;
use core::fmt;
#[cfg(feature = "std")]
pub trait Source: std::error::Error + Sync + Send + 'static {}
pub trait Source: core::error::Error + Sync + Send + 'static {}
#[cfg(feature = "std")]
impl<T> Source for T where T: std::error::Error + Sync + Send + 'static {}
impl<T> Source for T where T: core::error::Error + Sync + Send + 'static {}
#[cfg(not(feature = "std"))]
pub trait Source: fmt::Display + fmt::Debug + Send + Sync + 'static {}
@@ -25,7 +25,7 @@ pub struct Error<Kind> {
pub context: &'static str,
pub kind: Kind,
#[cfg(feature = "std")]
source: Option<Box<dyn std::error::Error + Sync + Send>>,
source: Option<Box<dyn core::error::Error + Sync + Send>>,
#[cfg(all(not(feature = "std"), feature = "alloc"))]
source: Option<Box<dyn Source>>,
}
@@ -94,11 +94,11 @@ where
}
#[cfg(feature = "std")]
impl<Kind> std::error::Error for Error<Kind>
impl<Kind> core::error::Error for Error<Kind>
where
Kind: std::error::Error,
Kind: core::error::Error,
{
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
if let Some(source) = self.kind.source() {
Some(source)
} else {
@@ -115,10 +115,10 @@ where
#[cfg(feature = "std")]
impl<Kind> From<Error<Kind>> for std::io::Error
where
Kind: std::error::Error + Send + Sync + 'static,
Kind: core::error::Error + Send + Sync + 'static,
{
fn from(error: Error<Kind>) -> Self {
Self::new(std::io::ErrorKind::Other, error)
Self::other(error)
}
}
@@ -127,10 +127,10 @@ pub struct ErrorReport<'a, Kind>(&'a Error<Kind>);
#[cfg(feature = "std")]
impl<Kind> fmt::Display for ErrorReport<'_, Kind>
where
Kind: std::error::Error,
Kind: core::error::Error,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use std::error::Error;
use core::error::Error;
write!(f, "{}", self.0)?;
+1 -1
View File
@@ -11,5 +11,5 @@ pub mod renderer;
mod draw;
mod surface;
type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
type Error = Box<dyn core::error::Error + Send + Sync + 'static>;
type Result<T> = std::result::Result<T, Error>;
+2 -2
View File
@@ -372,11 +372,11 @@ impl ColorStrideReader {
}
fn bit_stride_size_align_u8(size_bits: usize) -> usize {
(size_bits + 7) / 8
size_bits.div_ceil(8)
}
fn bit_stride_size_align_u16(size_bits: usize) -> usize {
((size_bits + 15) / 16) * 2
size_bits.div_ceil(16) * 2
}
/// Message-agnostic pointer data.
@@ -48,7 +48,7 @@ impl<'a> BitmapStreamDecoderImpl<'a> {
// its size is rounded up to the nearest greater integer, to take into account odd image
// size (e.g. if width is 3, then chroma plane width is 2, not 1, to take into account
// the odd column which expands to 1 pixel instead of 2 during supersampling)
((image_width + 1) / 2, (image_height + 1) / 2)
(image_width.div_ceil(2), image_height.div_ceil(2))
} else {
(image_width, image_height)
};

Some files were not shown because too many files have changed in this diff Show More