Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Jan 5, 2024
1 parent 8b6863d commit d69c28e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{
use crate::*;
use color_eyre::eyre::{bail, Context, ContextCompat};
use regex::Regex;
use tracing::{debug, info, instrument, trace, warn};
use tracing::{debug, info, instrument, warn};
use uzers::os::unix::UserExt;

// Nix impl:
Expand Down
4 changes: 1 addition & 3 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ use color_eyre::{
use std::ffi::{OsStr, OsString};
use thiserror::Error;

use tracing::{debug, info};
use subprocess::{Exec, ExitStatus, PopenError, Redirection};

use crate::*;
use tracing::{debug, info};

#[derive(Debug, derive_builder::Builder, Default)]
#[builder(derive(Debug), setter(into), default)]
Expand Down
9 changes: 2 additions & 7 deletions src/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::path::PathBuf;

use color_eyre::eyre::bail;
use color_eyre::Result;
use tracing::{debug, info, trace};
use thiserror::Error;
use tracing::{debug, info, trace};

use crate::*;
use crate::{
Expand Down Expand Up @@ -91,12 +91,7 @@ impl HomeRebuildArgs {
// just do nothing for None case (fresh installs)
if let Some(prev_gen) = prev_generation {
commands::CommandBuilder::default()
.args(&[
"nvd",
"diff",
(prev_gen.to_str().unwrap()),
out_link_str,
])
.args(&["nvd", "diff", (prev_gen.to_str().unwrap()), out_link_str])
.message("Comparing changes")
.build()?
.exec()?;
Expand Down
2 changes: 1 addition & 1 deletion src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ pub struct CleanProfileArgs {
#[command(flatten)]
pub common: CleanArgs,

pub profile: PathBuf
pub profile: PathBuf,
}

#[derive(Debug, Args)]
Expand Down
4 changes: 1 addition & 3 deletions src/logging.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::str::FromStr;

use crate::*;
use owo_colors::OwoColorize;
use tracing::Event;
Expand All @@ -8,7 +6,7 @@ use tracing::Subscriber;
use tracing_subscriber::filter::filter_fn;
use tracing_subscriber::filter::FilterExt;
use tracing_subscriber::fmt;
use tracing_subscriber::fmt::format::Format;

use tracing_subscriber::fmt::FormatEvent;
use tracing_subscriber::fmt::FormatFields;
use tracing_subscriber::prelude::*;
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ mod logging;
mod nixos;
mod search;


use crate::interface::NHParser;
use crate::interface::NHRunnable;
use color_eyre::Result;
use tracing::debug;

const NH_VERSION: &'static str = env!("CARGO_PKG_VERSION");
const NH_VERSION: &str = env!("CARGO_PKG_VERSION");

fn main() -> Result<()> {
let args = <NHParser as clap::Parser>::parse();
Expand Down
8 changes: 4 additions & 4 deletions src/search.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::*;
use color_eyre::eyre::Context;
use interface::SearchArgs;
use serde_json::{json, Value};
use std::{collections::HashMap, ops::Deref, process::Command, time::Instant};
use tracing::{debug, info, trace};

use std::time::Instant;
use tracing::{debug, trace};

use elasticsearch_dsl::*;
use serde::Deserialize;
Expand Down Expand Up @@ -131,7 +131,7 @@ impl NHRunnable for SearchArgs {
println!();

if let Some(ref desc) = elem.package_description {
let desc = desc.replace("\n", " ");
let desc = desc.replace('\n', " ");
for line in textwrap::wrap(&desc, textwrap::Options::with_termwidth()) {
println!(" {}", line);
}
Expand Down

0 comments on commit d69c28e

Please sign in to comment.