This commit is contained in:
ryneeverett 2023-01-15 17:00:03 -05:00 committed by Dustin J. Mitchell
parent 2f7196dbfc
commit 725dab681f
2 changed files with 10 additions and 10 deletions

View file

@ -5,8 +5,8 @@ use thiserror::Error;
#[non_exhaustive]
/// Errors returned from taskchampion operations
pub enum Error {
/// A crypto-related error
#[error("Crypto Error: {0}")]
/// A server-related error
#[error("Server Error: {0}")]
Server(String),
/// A task-database-related error
#[error("Task Database Error: {0}")]
@ -17,7 +17,7 @@ pub enum Error {
#[error("Local replica is out of sync with the server")]
OutOfSync,
/// A usage error
#[error("User Error: {0}")]
#[error("Usage Error: {0}")]
Usage(String),
/// A general error.
#[error(transparent)]
@ -25,7 +25,7 @@ pub enum Error {
}
/// Convert private and third party errors into Error::Other.
macro_rules! convert_error {
macro_rules! other_error {
( $error:ty ) => {
impl From<$error> for Error {
fn from(err: $error) -> Self {
@ -34,10 +34,10 @@ macro_rules! convert_error {
}
};
}
convert_error!(ureq::Error);
convert_error!(io::Error);
convert_error!(serde_json::Error);
convert_error!(rusqlite::Error);
convert_error!(crate::storage::sqlite::SqliteError);
other_error!(ureq::Error);
other_error!(io::Error);
other_error!(serde_json::Error);
other_error!(rusqlite::Error);
other_error!(crate::storage::sqlite::SqliteError);
pub type Result<T> = std::result::Result<T, Error>;

View file

@ -10,7 +10,7 @@ use uuid::Uuid;
pub(super) struct SnapshotTasks(Vec<(Uuid, TaskMap)>);
impl Serialize for SnapshotTasks {
fn serialize<'a, S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: Serializer,
{