style: reorder imports and adjust formatting
This commit is contained in:
committed by
Andrew Phillips (aider)
parent
97d89196ab
commit
6bbc306c23
@@ -1,5 +1,5 @@
|
|||||||
use std::io;
|
|
||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
|
use std::io;
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
|
|||||||
@@ -308,7 +308,9 @@ fn main() -> Result<(), Error> {
|
|||||||
crate::modes::get::mode_get(&mut cmd, args, ids, tags, &mut conn, data_path)?
|
crate::modes::get::mode_get(&mut cmd, args, ids, tags, &mut conn, data_path)?
|
||||||
}
|
}
|
||||||
KeepModes::Diff => mode_diff(&mut cmd, args, ids, tags, &mut conn, data_path)?,
|
KeepModes::Diff => mode_diff(&mut cmd, args, ids, tags, &mut conn, data_path)?,
|
||||||
KeepModes::List => crate::modes::list::mode_list(&mut cmd, args, ids, tags, &mut conn, data_path)?,
|
KeepModes::List => {
|
||||||
|
crate::modes::list::mode_list(&mut cmd, args, ids, tags, &mut conn, data_path)?
|
||||||
|
}
|
||||||
KeepModes::Update => {
|
KeepModes::Update => {
|
||||||
crate::modes::update::mode_update(&mut cmd, args, ids, tags, &mut conn, data_path)?
|
crate::modes::update::mode_update(&mut cmd, args, ids, tags, &mut conn, data_path)?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,15 +52,15 @@ pub fn get_format_box_chars_no_border_line_separator() -> TableFormat {
|
|||||||
.borders('│')
|
.borders('│')
|
||||||
.separators(
|
.separators(
|
||||||
&[prettytable::format::LinePosition::Top],
|
&[prettytable::format::LinePosition::Top],
|
||||||
prettytable::format::LineSeparator::new('─', '┬', '┌', '┐')
|
prettytable::format::LineSeparator::new('─', '┬', '┌', '┐'),
|
||||||
)
|
)
|
||||||
.separators(
|
.separators(
|
||||||
&[prettytable::format::LinePosition::Title],
|
&[prettytable::format::LinePosition::Title],
|
||||||
prettytable::format::LineSeparator::new('─', '┼', '├', '┤')
|
prettytable::format::LineSeparator::new('─', '┼', '├', '┤'),
|
||||||
)
|
)
|
||||||
.separators(
|
.separators(
|
||||||
&[prettytable::format::LinePosition::Bottom],
|
&[prettytable::format::LinePosition::Bottom],
|
||||||
prettytable::format::LineSeparator::new('─', '┴', '└', '┘')
|
prettytable::format::LineSeparator::new('─', '┴', '└', '┘'),
|
||||||
)
|
)
|
||||||
.padding(1, 1)
|
.padding(1, 1)
|
||||||
.build()
|
.build()
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ use clap::Command;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use crate::modes::common::{format_size, get_format_box_chars_no_border_line_separator}; // Add function import
|
|
||||||
use is_terminal::IsTerminal;
|
|
||||||
use crate::compression::get_engine;
|
use crate::compression::get_engine;
|
||||||
use crate::compression::CompressionType;
|
use crate::compression::CompressionType;
|
||||||
use crate::db::{get_item, get_item_last, get_item_matching};
|
use crate::db::{get_item, get_item_last, get_item_matching};
|
||||||
|
use crate::modes::common::{format_size, get_format_box_chars_no_border_line_separator}; // Add function import
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
|
use is_terminal::IsTerminal;
|
||||||
use prettytable::format;
|
use prettytable::format;
|
||||||
use prettytable::{Attr, Cell, Row, Table};
|
use prettytable::{Attr, Cell, Row, Table};
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use log::debug;
|
|
||||||
use chrono::Local;
|
use chrono::Local;
|
||||||
use prettytable::format::consts;
|
|
||||||
use clap::Command;
|
use clap::Command;
|
||||||
|
use log::debug;
|
||||||
|
use prettytable::format::consts;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use crate::db::{get_item, get_item_last, get_items, get_items_matching, Item, Tag, Meta};
|
use crate::db::{get_item, get_item_last, get_items, get_items_matching, Item, Meta, Tag};
|
||||||
use std::io::{ErrorKind};
|
|
||||||
use crate::modes::common::{format_size, get_format_box_chars_no_border_line_separator};
|
use crate::modes::common::{format_size, get_format_box_chars_no_border_line_separator};
|
||||||
use rusqlite::Connection;
|
|
||||||
use crate::modes::common::{size_column, string_column};
|
use crate::modes::common::{size_column, string_column};
|
||||||
use prettytable::row;
|
use prettytable::row;
|
||||||
use prettytable::{Attr, Cell, Row, Table};
|
use prettytable::{Attr, Cell, Row, Table};
|
||||||
|
use rusqlite::Connection;
|
||||||
|
use std::io::ErrorKind;
|
||||||
|
|
||||||
pub fn mode_list(
|
pub fn mode_list(
|
||||||
cmd: &mut Command,
|
cmd: &mut Command,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
|
use is_terminal::IsTerminal;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io::{self, Read};
|
use std::io::{self, Read};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use is_terminal::IsTerminal;
|
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use clap::error::ErrorKind;
|
use clap::error::ErrorKind;
|
||||||
@@ -12,7 +12,7 @@ use rusqlite::Connection;
|
|||||||
|
|
||||||
use crate::compression::CompressionType;
|
use crate::compression::CompressionType;
|
||||||
use crate::db::{self};
|
use crate::db::{self};
|
||||||
use crate::modes::common::{get_meta_from_env};
|
use crate::modes::common::get_meta_from_env;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
|
||||||
pub fn mode_save(
|
pub fn mode_save(
|
||||||
@@ -40,7 +40,7 @@ pub fn mode_save(
|
|||||||
.compression
|
.compression
|
||||||
.unwrap_or(compression::default_type().to_string());
|
.unwrap_or(compression::default_type().to_string());
|
||||||
|
|
||||||
use gethostname::gethostname;
|
use gethostname::gethostname;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
let compression_type_opt = CompressionType::from_str(&compression_name);
|
let compression_type_opt = CompressionType::from_str(&compression_name);
|
||||||
if compression_type_opt.is_err() {
|
if compression_type_opt.is_err() {
|
||||||
@@ -119,7 +119,7 @@ use gethostname::gethostname;
|
|||||||
let mut stdout = io::stdout().lock();
|
let mut stdout = io::stdout().lock();
|
||||||
let mut buffer = [0; libc::BUFSIZ as usize];
|
let mut buffer = [0; libc::BUFSIZ as usize];
|
||||||
|
|
||||||
use crate::compression;
|
use crate::compression;
|
||||||
let compression_engine = compression::get_engine(compression_type.clone())
|
let compression_engine = compression::get_engine(compression_type.clone())
|
||||||
.expect("Unable to get compression engine");
|
.expect("Unable to get compression engine");
|
||||||
let mut item_out: Box<dyn Write> =
|
let mut item_out: Box<dyn Write> =
|
||||||
|
|||||||
Reference in New Issue
Block a user