diff --git a/Makefile b/Makefile index ac068836..736d5084 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/src/clipboard.rs b/src/clipboard.rs index 2828ff65..1654311f 100644 --- a/src/clipboard.rs +++ b/src/clipboard.rs @@ -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(()) }