fix nightly build

This commit is contained in:
Stephan Dilly 2020-09-27 18:56:20 +02:00
parent 17240e47fc
commit a991810f01
2 changed files with 11 additions and 3 deletions

View File

@ -45,6 +45,11 @@ clippy:
cargo clean -p gitui -p asyncgit -p scopetime
cargo clippy --all-features
clippy-nightly:
touch src/main.rs
cargo clean -p gitui -p asyncgit -p scopetime
cargo +nightly clippy --all-features
clippy-pedantic:
cargo clean -p gitui -p asyncgit -p scopetime
cargo clippy --all-features -- -W clippy::pedantic

View File

@ -7,9 +7,12 @@ pub fn copy_string(string: String) -> Result<()> {
use anyhow::anyhow;
let mut ctx: ClipboardContext = ClipboardProvider::new()
.map_err(|_| anyhow!("failed to get access to clipboard"))?;
ctx.set_contents(string)
.map_err(|_| anyhow!("failed to set clipboard contents"))?;
.map_err(|e| {
anyhow!("failed to get access to clipboard: {}", e)
})?;
ctx.set_contents(string).map_err(|e| {
anyhow!("failed to set clipboard contents: {}", e)
})?;
Ok(())
}