remove unchecked unwrap
This commit is contained in:
parent
8f353d965a
commit
eae540e3e7
2 changed files with 3 additions and 3 deletions
|
@ -62,7 +62,7 @@ async fn update_to(revision: Revision) -> Result<(), UpdateError> {
|
||||||
pub(super) async fn run(revision: Option<Revision>) -> Result<(), UpdateError> {
|
pub(super) async fn run(revision: Option<Revision>) -> Result<(), UpdateError> {
|
||||||
let current_revision = current_revision()?;
|
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)");
|
println!("Your config files are already up-to-date! (as of this fishctl release)");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
command::config::{current_revision, RevisionCheckError},
|
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 color_print::cprintln;
|
||||||
use enum_iterator::Sequence;
|
use enum_iterator::Sequence;
|
||||||
|
@ -31,7 +31,7 @@ enum ReadError {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn run() -> Result<(), ValidationError> {
|
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.");
|
cprintln!("Please first run `<bold>fishctl config update</>` to update your config files.");
|
||||||
return Err(ValidationError::OutOfDate);
|
return Err(ValidationError::OutOfDate);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue