summaryrefslogtreecommitdiffstats
path: root/src/utils.rs
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2023-10-08 22:45:32 +0200
committerqkzk <qu3nt1n@gmail.com>2023-10-09 14:09:48 +0200
commit0cee1460a8389b15220b9505bcea72a5ac920218 (patch)
tree21e7f7ba25d9ac9096a53c0d159d6a1dc455de86 /src/utils.rs
parentd841a29aadc1edc4b16a272fa694e97050f88853 (diff)
refactor main. Use a struct responsible for setup, update, display and quit.
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/utils.rs b/src/utils.rs
index cea7140..2305991 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -1,7 +1,6 @@
use std::borrow::Borrow;
use std::io::BufRead;
use std::path::Path;
-use std::sync::Arc;
use anyhow::{Context, Result};
use copypasta::{ClipboardContext, ClipboardProvider};
@@ -10,11 +9,8 @@ use tuikit::term::Term;
use users::{get_current_uid, get_user_by_uid};
use crate::content_window::ContentWindow;
-use crate::event_dispatch::EventDispatcher;
use crate::fileinfo::human_size;
use crate::nvim::nvim;
-use crate::status::Status;
-use crate::term_manager::{Display, EventReader};
/// Returns a `Display` instance after `tuikit::term::Term` creation.
pub fn init_term() -> Result<Term> {
@@ -65,19 +61,6 @@ pub fn opt_mount_point(disk: Option<&Disk>) -> Option<&std::path::Path> {
Some(disk.mount_point())
}
-/// Drops everything passed to it
-/// It's used if the user wants to "cd on quit" which is a nice feature I
-/// wanted to implement.
-/// Since tuikit term redirects stdout, we have to drop them first.
-#[macro_export]
-macro_rules! drop_all {
- ($( $x:ident ),* ) => {
- $(
- std::mem::drop($x);
- )*
- };
-}
-
/// Print the path on the stdout.
pub fn print_on_quit(path_string: &str) {
println!("{path_string}")