summaryrefslogtreecommitdiffstats
path: root/src/utils.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-07 19:04:54 +0800
committerGitHub <noreply@github.com>2023-03-07 19:04:54 +0800
commitc7fcdb174440817706b818154a6bbcaf58948caa (patch)
tree4dabd9df9142cdceeca044e166545fd2cc26df36 /src/utils.rs
parentd73be65b07c22f69539b5819f0684090c32d3b60 (diff)
downloadaichat-c7fcdb174440817706b818154a6bbcaf58948caa.tar.gz
refactor: adjust repl (#30)
- abandon .copy - rename .multiple => .editor - if command successed, do not output `Done` - if command failed, output `Error: <error message>`
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/utils.rs b/src/utils.rs
index 9dfbbd7..5a18948 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -1,6 +1,4 @@
-use anyhow::{anyhow, Result};
use chrono::prelude::*;
-use copypasta::{ClipboardContext, ClipboardProvider};
use std::io::{stdout, Write};
pub fn dump<T: ToString>(text: T, newlines: usize) {
@@ -8,12 +6,6 @@ pub fn dump<T: ToString>(text: T, newlines: usize) {
let _ = stdout().flush();
}
-pub fn copy(src: &str) -> Result<()> {
- ClipboardContext::new()
- .and_then(|mut ctx| ctx.set_contents(src.to_string()))
- .map_err(|err| anyhow!("Failed to copy, {err}"))
-}
-
pub fn now() -> String {
let now = Local::now();
now.to_rfc3339_opts(SecondsFormat::Secs, false)