From a86e4d7ecb8ec641a993a2ef69412ada0666f4f4 Mon Sep 17 00:00:00 2001 From: ComplexSpaces Date: Tue, 21 Nov 2023 21:31:11 -0600 Subject: [PATCH] Bump to Rust 2021 edition --- Cargo.toml | 2 +- src/platform/linux/mod.rs | 2 +- src/platform/linux/wayland.rs | 4 ++-- src/platform/osx.rs | 3 +-- src/platform/windows.rs | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fadda64..97dfbca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ repository = "https://github.com/1Password/arboard" license = "MIT OR Apache-2.0" readme = "README.md" keywords = ["clipboard", "image"] -edition = "2018" +edition = "2021" rust-version = "1.61" [features] diff --git a/src/platform/linux/mod.rs b/src/platform/linux/mod.rs index 79264e4..5bb28f5 100644 --- a/src/platform/linux/mod.rs +++ b/src/platform/linux/mod.rs @@ -13,7 +13,7 @@ mod x11; mod wayland; fn into_unknown(error: E) -> Error { - Error::Unknown { description: format!("{}", error) } + Error::Unknown { description: error.to_string() } } #[cfg(feature = "image-data")] diff --git a/src/platform/linux/wayland.rs b/src/platform/linux/wayland.rs index 955a736..c2b316d 100644 --- a/src/platform/linux/wayland.rs +++ b/src/platform/linux/wayland.rs @@ -71,7 +71,7 @@ impl Clipboard { Err(PasteError::PrimarySelectionUnsupported) => Err(Error::ClipboardNotSupported), - Err(err) => Err(Error::Unknown { description: format!("{}", err) }), + Err(err) => Err(Error::Unknown { description: err.to_string() }), } } @@ -154,7 +154,7 @@ impl Clipboard { Err(Error::ContentNotAvailable) } - Err(err) => Err(Error::Unknown { description: format!("{}", err) }), + Err(err) => Err(Error::Unknown { description: err.to_string() }), } } diff --git a/src/platform/osx.rs b/src/platform/osx.rs index cc7a4e7..c48df73 100644 --- a/src/platform/osx.rs +++ b/src/platform/osx.rs @@ -282,8 +282,7 @@ impl<'clipboard> Set<'clipboard> { // https://bugzilla.mozilla.org/show_bug.cgi?id=466599 // https://bugs.chromium.org/p/chromium/issues/detail?id=11957 let html = format!( - r#"{}"#, - html + r#"{html}"#, ); let html_nss = NSString::from_str(&html); // Make sure that we pass a pointer to the string and not the object itself. diff --git a/src/platform/windows.rs b/src/platform/windows.rs index c17d2d6..ed116df 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -554,7 +554,7 @@ impl<'clipboard> Set<'clipboard> { if let Err(e) = clipboard_win::raw::empty() { return Err(Error::Unknown { - description: format!("Failed to empty the clipboard. Got error code: {}", e), + description: format!("Failed to empty the clipboard. Got error code: {e}"), }); };