remove unchecked unwrap

This commit is contained in:
naskya 2024-06-21 10:46:29 +09:00
parent 8f353d965a
commit eae540e3e7
Signed by: naskya
GPG key ID: 712D413B3A9FED5C
2 changed files with 3 additions and 3 deletions

View file

@ -62,7 +62,7 @@ async fn update_to(revision: Revision) -> Result<(), UpdateError> {
pub(super) async fn run(revision: Option<Revision>) -> Result<(), UpdateError> {
let current_revision = current_revision()?;
if current_revision == Revision::last().unwrap() {
if current_revision.next().is_none() {
println!("Your config files are already up-to-date! (as of this fishctl release)");
return Ok(());
}

View file

@ -2,7 +2,7 @@
use crate::{
command::config::{current_revision, RevisionCheckError},
config::{client, server, Revision, CLIENT_CONFIG_PATH, SERVER_CONFIG_PATH},
config::{client, server, CLIENT_CONFIG_PATH, SERVER_CONFIG_PATH},
};
use color_print::cprintln;
use enum_iterator::Sequence;
@ -31,7 +31,7 @@ enum ReadError {
}
pub(super) fn run() -> Result<(), ValidationError> {
if current_revision()? != Revision::last().unwrap() {
if current_revision()?.next().is_some() {
cprintln!("Please first run `<bold>fishctl config update</>` to update your config files.");
return Err(ValidationError::OutOfDate);
}