Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update notify-rust to 4.7 #114

Merged
merged 1 commit into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ edition = "2018"
[dependencies]
alpm = "2.1.0"
clap = { version = "4.1.1", features = ["help", "usage", "error-context", "std", "derive"], default-features = false }
notify-rust = "4.5"
notify-rust = "4.7"
utmp-rs = "0.3.0"
time = "0.3.14"
log = "0.4.17"
Expand Down
12 changes: 1 addition & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::{num::ParseIntError, str::FromStr};

use clap::Parser;
use log::error;
use notify_rust::{Notification, Timeout};
Expand All @@ -15,14 +13,6 @@ mod critical_packages_check;
use critical_packages_check::CriticalPackagesCheck;
mod session;

fn timeout_from_str(s: &str) -> Result<Timeout, ParseIntError> {
match s {
"default" => Ok(Timeout::Default),
"never" => Ok(Timeout::Never),
milliseconds => Ok(Timeout::Milliseconds(u32::from_str(milliseconds)?)),
}
}

#[derive(Debug, Parser)]
#[clap(
version,
Expand All @@ -40,7 +30,7 @@ struct Args {
/// * "never" or "0" will cause the notification never to expire.
///
/// * Any other number will be interpreted as the timeout in milliseconds.
#[clap(long, value_parser(timeout_from_str), default_value = "default")]
#[clap(long, default_value = "default")]
notification_timeout: Timeout,

/// Comma separated list of packages were we should reboot after an upgrade.
Expand Down