diff options
| author | sigoden <sigoden@gmail.com> | 2023-10-27 23:45:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-27 23:45:26 +0800 |
| commit | 1575d441724a27854c8f9fe1510a47a3050ae28d (patch) | |
| tree | d4667a05fb0ce051e9081192f1ebf9d814a060f2 /src/utils | |
| parent | 7298dbc165f85b23739ebae6c5b10a54c40ebea3 (diff) | |
| download | aichat-1575d441724a27854c8f9fe1510a47a3050ae28d.tar.gz | |
fix: .copy don't works on some linux distro (#161)
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/mod.rs | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 3ae1004..4ed0d5a 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -3,7 +3,6 @@ mod tiktoken; use self::tiktoken::cl100k_base; pub use self::tiktoken::{cl100k_base_singleton, count_tokens, text_to_tokens, tokens_to_text}; -use arboard::Clipboard; use chrono::prelude::*; use crossterm::style::{Color, Stylize}; use std::io::{stdout, Write}; @@ -38,11 +37,6 @@ pub fn emphasis(text: &str) -> String { text.stylize().with(Color::White).to_string() } -pub fn copy(src: &str) -> Result<(), arboard::Error> { - let mut clipboard = Clipboard::new()?; - clipboard.set_text(src) -} - pub fn split_text(text: &str) -> Result<Vec<String>, anyhow::Error> { let bpe = cl100k_base()?; let tokens = bpe.encode_with_special_tokens(text); |
