Skip to content

Commit

Permalink
no good reason to use thiserror here
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Dec 31, 2023
1 parent 4119199 commit 5ac433a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ serde_json = "1.0"
serde_repr = "0.1"
rmp-serde = "1"
anyhow = "1.0.31"
thiserror = "1.0"
url = { version = "2.2", features = ["serde"] }
base64 = "0.21"
hex = "0.4.3"
Expand Down
14 changes: 4 additions & 10 deletions src/cron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use std::collections::HashMap;
use anyhow::{bail, Result};
use diesel::prelude::*;
use serde_json::{self, json};
use thiserror::Error;

use rocket::uri;

Expand All @@ -30,12 +29,6 @@ use crate::routes;
use crate::schema::*;
use crate::util::Ctx;

#[derive(Debug, Error)]
enum NodeListError {
#[error("got unsupported version number {version}")]
UnsupportedVersion { version: usize },
}

mod json {
use chrono::{DateTime, Utc};
use serde::Deserialize;
Expand Down Expand Up @@ -128,9 +121,10 @@ impl<'r> Ctx<'r> {
.await?;

if cur_nodes.version != 2 {
bail!(NodeListError::UnsupportedVersion {
version: cur_nodes.version
});
bail!(
"unsupported hopglass node list version: {}",
cur_nodes.version
);
}

// Build node HashMap: map node ID to name and online state
Expand Down

0 comments on commit 5ac433a

Please sign in to comment.