From c7fcdb174440817706b818154a6bbcaf58948caa Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 7 Mar 2023 19:04:54 +0800 Subject: refactor: adjust repl (#30) - abandon .copy - rename .multiple => .editor - if command successed, do not output `Done` - if command failed, output `Error: ` --- src/utils.rs | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/utils.rs') 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(text: T, newlines: usize) { @@ -8,12 +6,6 @@ pub fn dump(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) -- cgit v1.2.3