From 15a2ffd7e6e1269f7c830b2a9df2824dd317a578 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Mon, 11 Nov 2024 14:59:25 +0100 Subject: [PATCH] style: optimize imports with cargo fix --- src/event_sender.rs | 28 ++-------------------------- src/kinds.rs | 2 +- src/main.rs | 5 +---- src/tasks.rs | 4 ++-- 4 files changed, 6 insertions(+), 33 deletions(-) diff --git a/src/event_sender.rs b/src/event_sender.rs index 4d9baa1..88ce4ee 100644 --- a/src/event_sender.rs +++ b/src/event_sender.rs @@ -1,36 +1,12 @@ use std::cell::RefCell; -use std::collections::{HashMap, VecDeque}; -use std::env::{args, var}; -use std::fs; -use std::fs::File; -use std::io::{BufRead, BufReader, Write}; use std::ops::Sub; -use std::path::PathBuf; -use std::str::FromStr; -use std::time::Duration; -use chrono::Local; -use colored::Colorize; -use directories::ProjectDirs; -use env_logger::{Builder, Target, WriteStyle}; -use itertools::Itertools; use nostr_sdk::prelude::*; -use nostr_sdk::TagStandard::Hashtag; -use regex::Regex; -use rustyline::config::Configurer; -use rustyline::error::ReadlineError; -use rustyline::DefaultEditor; -use tokio::sync::mpsc; use tokio::sync::mpsc::Sender; -use tokio::time::error::Elapsed; -use tokio::time::timeout; -use crate::helpers::*; -use crate::kinds::{Prio, BASIC_KINDS, PROPERTY_COLUMNS, PROP_KINDS, TRACKING_KIND}; -use crate::task::{State, Task, TaskState}; +use crate::kinds::TRACKING_KIND; use crate::tasks; -use crate::tasks::{PropertyCollection, StateFilter, TasksRelay}; -use log::{debug, error, info, trace, warn, LevelFilter}; +use log::{debug, error, info, trace, warn}; use nostr_sdk::Event; const UNDO_DELAY: u64 = 60; diff --git a/src/kinds.rs b/src/kinds.rs index 732653e..1abc217 100644 --- a/src/kinds.rs +++ b/src/kinds.rs @@ -1,4 +1,4 @@ -use crate::task::{State, MARKER_PARENT}; +use crate::task::MARKER_PARENT; use crate::tasks::HIGH_PRIO; use itertools::Itertools; use log::info; diff --git a/src/main.rs b/src/main.rs index 5943e2f..e1b0370 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,17 +1,15 @@ -use std::cell::RefCell; use std::collections::{HashMap, VecDeque}; use std::env::{args, var}; use std::fs; use std::fs::File; use std::io::{BufRead, BufReader, Write}; -use std::ops::Sub; use std::path::PathBuf; use std::str::FromStr; use std::time::Duration; use crate::event_sender::MostrMessage; use crate::helpers::*; -use crate::kinds::{Prio, BASIC_KINDS, PROPERTY_COLUMNS, PROP_KINDS, TRACKING_KIND}; +use crate::kinds::{Prio, BASIC_KINDS, PROPERTY_COLUMNS, PROP_KINDS}; use crate::task::{State, Task, TaskState}; use crate::tasks::{PropertyCollection, StateFilter, TasksRelay}; use chrono::Local; @@ -27,7 +25,6 @@ use rustyline::config::Configurer; use rustyline::error::ReadlineError; use rustyline::DefaultEditor; use tokio::sync::mpsc; -use tokio::sync::mpsc::Sender; use tokio::time::error::Elapsed; use tokio::time::timeout; diff --git a/src/tasks.rs b/src/tasks.rs index 149bf0a..4666a15 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -1,6 +1,6 @@ use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque}; use std::fmt::{Display, Formatter}; -use std::io::{stdout, Error, Write}; +use std::io::Write; use std::iter::{empty, once, FusedIterator}; use std::ops::{Div, Rem}; use std::str::FromStr; @@ -11,7 +11,7 @@ use crate::helpers::{format_timestamp_local, format_timestamp_relative, format_t use crate::kinds::*; use crate::task::{State, Task, TaskState, MARKER_DEPENDS, MARKER_PARENT, MARKER_PROPERTY}; use colored::Colorize; -use itertools::{Either, Itertools}; +use itertools::Itertools; use log::{debug, error, info, trace, warn}; use nostr_sdk::prelude::Marker; use nostr_sdk::{Event, EventBuilder, EventId, JsonUtil, Keys, Kind, Metadata, PublicKey, Tag, TagStandard, Timestamp, UncheckedUrl, Url};