mirror of
https://github.com/icewind1991/notify-redis.git
synced 2026-06-03 18:24:12 +02:00
fmt
This commit is contained in:
parent
2a01af9db0
commit
9cbfb0ff3e
2 changed files with 8 additions and 6 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -1,3 +1,5 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "ascii"
|
||||
version = "0.9.1"
|
||||
|
|
|
|||
12
src/main.rs
12
src/main.rs
|
|
@ -1,12 +1,12 @@
|
|||
use notify::{DebouncedEvent, RecommendedWatcher, RecursiveMode, Watcher};
|
||||
use redis::{Client, Commands, Connection, RedisResult};
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::fmt;
|
||||
use std::fmt::Display;
|
||||
use std::result::Result;
|
||||
use std::sync::mpsc::channel;
|
||||
use std::time::Duration;
|
||||
use std::fmt::Display;
|
||||
use std::fmt;
|
||||
use std::error::Error;
|
||||
|
||||
#[derive(Debug)]
|
||||
enum WatchError {
|
||||
|
|
@ -30,16 +30,16 @@ impl Display for WatchError {
|
|||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
WatchError::Redis(err) => err.fmt(f),
|
||||
WatchError::Notify(err) => err.fmt(f)
|
||||
WatchError::Notify(err) => err.fmt(f),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for WatchError {
|
||||
fn cause(&self) -> Option<&Error> {
|
||||
fn cause(&self) -> Option<&dyn Error> {
|
||||
match self {
|
||||
WatchError::Redis(err) => Some(err),
|
||||
WatchError::Notify(err) => Some(err)
|
||||
WatchError::Notify(err) => Some(err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue