diff options
| author | sigoden <sigoden@gmail.com> | 2024-11-30 06:48:35 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-30 06:48:35 +0800 |
| commit | 580b40e895f6b5d4b9ee350bfd0066cfe4ae5bcc (patch) | |
| tree | d88dd7bd89004901ca3186207b78de81beac6b17 /src/utils/clipboard.rs | |
| parent | c06ecffb4c43a83484b77882c9880878be11c71f (diff) | |
| download | aichat-580b40e895f6b5d4b9ee350bfd0066cfe4ae5bcc.tar.gz | |
refactor: several improvements (#1020)
- update models.yaml
- update copy error message
- update combined files style
Diffstat (limited to 'src/utils/clipboard.rs')
| -rw-r--r-- | src/utils/clipboard.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/clipboard.rs b/src/utils/clipboard.rs index c4444e3..23bb4f3 100644 --- a/src/utils/clipboard.rs +++ b/src/utils/clipboard.rs @@ -13,12 +13,12 @@ pub fn set_text(text: &str) -> anyhow::Result<()> { #[cfg(target_os = "linux")] std::thread::sleep(std::time::Duration::from_millis(50)); } - None => anyhow::bail!("Failed to copy the text; no available clipboard"), + None => return Err(anyhow::anyhow!("No clipboard available").context("Failed to copy")), } Ok(()) } #[cfg(any(target_os = "android", target_os = "emscripten"))] pub fn set_text(_text: &str) -> anyhow::Result<()> { - anyhow::bail!("Failed to copy the text; no available clipboard") + Err(anyhow::anyhow!("No clipboard available").context("Failed to copy")) } |
