From 9345fb754ac1997a9c9e19578bdc3c933c27e69e Mon Sep 17 00:00:00 2001 From: Nicola Spieser Buiss Date: Tue, 17 Feb 2026 07:29:50 +0100 Subject: [PATCH] fix: correct typos and improve code clarity (#14341) - Fix 'clipbard' typos in clipboard.rs (function names, comments, strings) - Fix 'seperate' typo in x11/server.rs comment - Replace !is_ok() with idiomatic is_err() in updater.rs - Fix double backtick typo in updater.rs comment Co-authored-by: Ocean --- libs/scrap/src/x11/server.rs | 2 +- src/clipboard.rs | 10 +++++----- src/updater.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/scrap/src/x11/server.rs b/libs/scrap/src/x11/server.rs index f9983f7cf2a..7ae145d4091 100644 --- a/libs/scrap/src/x11/server.rs +++ b/libs/scrap/src/x11/server.rs @@ -98,7 +98,7 @@ unsafe fn check_x11_shm_available(c: *mut xcb_connection_t) -> Result<(), Error> let mut e: *mut xcb_generic_error_t = std::ptr::null_mut(); let reply = xcb_shm_query_version_reply(c, cookie, &mut e as _); if reply.is_null() { - // TODO: Should seperate SHM disabled from SHM not supported? + // TODO: Should separate SHM disabled from SHM not supported? return Err(Error::UnsupportedExtension); } else { // https://github.com/FFmpeg/FFmpeg/blob/6229e4ac425b4566446edefb67d5c225eb397b58/libavdevice/xcbgrab.c#L229 diff --git a/src/clipboard.rs b/src/clipboard.rs index 4280cd1248b..cae7d03acbc 100644 --- a/src/clipboard.rs +++ b/src/clipboard.rs @@ -197,7 +197,7 @@ pub fn check_clipboard_cm() -> ResultType { #[cfg(not(target_os = "android"))] fn update_clipboard_(multi_clipboards: Vec, side: ClipboardSide) { - let to_update_data = proto::from_multi_clipbards(multi_clipboards); + let to_update_data = proto::from_multi_clipboards(multi_clipboards); if to_update_data.is_empty() { return; } @@ -432,7 +432,7 @@ impl ClipboardContext { #[cfg(target_os = "macos")] let is_kde_x11 = false; let clear_holder_text = if is_kde_x11 { - "RustDesk placeholder to clear the file clipbard" + "RustDesk placeholder to clear the file clipboard" } else { "" } @@ -672,7 +672,7 @@ mod proto { } #[cfg(not(target_os = "android"))] - pub fn from_multi_clipbards(multi_clipboards: Vec) -> Vec { + pub fn from_multi_clipboards(multi_clipboards: Vec) -> Vec { multi_clipboards .into_iter() .filter_map(from_clipboard) @@ -814,7 +814,7 @@ pub mod clipboard_listener { subscribers: listener_lock.subscribers.clone(), }; let (tx_start_res, rx_start_res) = channel(); - let h = start_clipbard_master_thread(handler, tx_start_res); + let h = start_clipboard_master_thread(handler, tx_start_res); let shutdown = match rx_start_res.recv() { Ok((Some(s), _)) => s, Ok((None, err)) => { @@ -854,7 +854,7 @@ pub mod clipboard_listener { log::info!("Clipboard listener unsubscribed: {}", name); } - fn start_clipbard_master_thread( + fn start_clipboard_master_thread( handler: impl ClipboardHandler + Send + 'static, tx_start_res: Sender<(Option, String)>, ) -> JoinHandle<()> { diff --git a/src/updater.rs b/src/updater.rs index e1badd00566..c1ff60b46fd 100644 --- a/src/updater.rs +++ b/src/updater.rs @@ -123,7 +123,7 @@ fn check_update(manually: bool) -> ResultType<()> { if !(manually || config::Config::get_bool_option(config::keys::OPTION_ALLOW_AUTO_UPDATE)) { return Ok(()); } - if !do_check_software_update().is_ok() { + if do_check_software_update().is_err() { // ignore return Ok(()); } @@ -185,7 +185,7 @@ fn check_update(manually: bool) -> ResultType<()> { let mut file = std::fs::File::create(&file_path)?; file.write_all(&file_data)?; } - // We have checked if the `conns`` is empty before, but we need to check again. + // We have checked if the `conns` is empty before, but we need to check again. // No need to care about the downloaded file here, because it's rare case that the `conns` are empty // before the download, but not empty after the download. if has_no_active_conns() {