refactor: various clippy lints
Some checks failed
Security audit / security_audit (pull_request) Has been cancelled
Conventional Commits / Conventional Commits (pull_request) Successful in 6s
Check Flake / security_audit (pull_request) Successful in 7m2s

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
Christina Sørensen 2024-09-07 11:44:24 +02:00
parent 0863eae4b4
commit b05095ff35
Signed by: cafkafk
GPG key ID: 26C542FD97F965CE
4 changed files with 8 additions and 13 deletions

View file

@ -27,7 +27,10 @@ fn main() -> Result<(), Error> {
let mut cmd = build_cli(); let mut cmd = build_cli();
for &shell in Shell::value_variants() { for &shell in Shell::value_variants() {
// HACK: this is gross :( // HACK: this is gross :(
let output = std::process::Command::new("mkdir").arg("man").output(); std::process::Command::new("mkdir")
.arg("man")
.output()
.expect("failed to make man directory");
generate_to(shell, &mut cmd, "nix-weather", &outdir)?; generate_to(shell, &mut cmd, "nix-weather", &outdir)?;
} }

View file

@ -3,15 +3,11 @@
// //
// SPDX-License-Identifier: EUPL-1.2 // SPDX-License-Identifier: EUPL-1.2
use std::{cell::OnceCell, sync::OnceLock}; use clap::{arg, command, crate_authors, value_parser, ArgAction, Command};
use clap::{arg, command, crate_authors, value_parser, Arg, ArgAction, Command};
const DEFAULT_CACHE: &str = "cache.nixos.org"; const DEFAULT_CACHE: &str = "cache.nixos.org";
pub fn build_cli() -> Command { pub fn build_cli() -> Command {
use std::path::PathBuf;
command!() command!()
.author(crate_authors!("\n")) .author(crate_authors!("\n"))
.arg( .arg(

View file

@ -3,7 +3,7 @@
// //
// SPDX-License-Identifier: EUPL-1.2 // SPDX-License-Identifier: EUPL-1.2
use std::time::{Duration, Instant}; use std::time::Instant;
use std::{env, io, net::SocketAddr}; use std::{env, io, net::SocketAddr};
use dns_lookup::lookup_host; use dns_lookup::lookup_host;
@ -11,8 +11,6 @@ use futures::future::join_all;
use gethostname::gethostname; use gethostname::gethostname;
use itertools::Itertools; use itertools::Itertools;
use log;
use crate::nix::get_requisites; use crate::nix::get_requisites;
mod cli; mod cli;
@ -35,8 +33,8 @@ async fn main() -> io::Result<()> {
let matches = cli::build_cli().get_matches(); let matches = cli::build_cli().get_matches();
/// If the users inputs more -v flags than we have log levels, send them a // If the users inputs more -v flags than we have log levels, send them a
/// message informing them. // message informing them.
let mut very_bose = false; let mut very_bose = false;
match matches match matches

View file

@ -8,8 +8,6 @@ use std::time::Duration;
use reqwest::Client; use reqwest::Client;
use tokio::time::sleep; use tokio::time::sleep;
use log;
const MAX_SLIDE: u64 = 1000; const MAX_SLIDE: u64 = 1000;
pub async fn nar_exists(client: Client, domain: &str, hash: &str, slide: u64) -> usize { pub async fn nar_exists(client: Client, domain: &str, hash: &str, slide: u64) -> usize {