Skip to content

Commit

Permalink
Bump to Rust 2021 edition
Browse files Browse the repository at this point in the history
  • Loading branch information
complexspaces committed Nov 22, 2023
1 parent 9182184 commit a86e4d7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/platform/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mod x11;
mod wayland;

fn into_unknown<E: std::fmt::Display>(error: E) -> Error {
Error::Unknown { description: format!("{}", error) }
Error::Unknown { description: error.to_string() }
}

#[cfg(feature = "image-data")]
Expand Down
4 changes: 2 additions & 2 deletions src/platform/linux/wayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() }),
}
}

Expand Down Expand Up @@ -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() }),
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/platform/osx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body>{}</body></html>"#,
html
r#"<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body>{html}</body></html>"#,
);
let html_nss = NSString::from_str(&html);
// Make sure that we pass a pointer to the string and not the object itself.
Expand Down
2 changes: 1 addition & 1 deletion src/platform/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"),
});
};

Expand Down

0 comments on commit a86e4d7

Please sign in to comment.