diff options
author | Quang Luong <quangio@outlook.com> | 2020-09-18 11:20:06 +0700 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2020-10-08 10:19:51 +0200 |
commit | 9b53a9d1a61115a328ca43955153d09cc2e969ef (patch) | |
tree | b84d83a431dfdc5777e61d40c60c7b0de088f8fd /src/wireguard/router/types.rs | |
parent | Added MIT license (diff) | |
download | wireguard-rs-9b53a9d1a61115a328ca43955153d09cc2e969ef.tar.xz wireguard-rs-9b53a9d1a61115a328ca43955153d09cc2e969ef.zip |
Fix some clippy warnings
Signed-off-by: Quang Luong <quangio@outlook.com>
Diffstat (limited to 'src/wireguard/router/types.rs')
-rw-r--r-- | src/wireguard/router/types.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/wireguard/router/types.rs b/src/wireguard/router/types.rs index e0cd459..e44963f 100644 --- a/src/wireguard/router/types.rs +++ b/src/wireguard/router/types.rs @@ -15,16 +15,16 @@ impl<T> Opaque for T where T: Send + Sync + 'static {} /// * `0`, a reference to the opaque value assigned to the peer /// * `1`, a bool indicating whether the message contained data (not just keepalive) /// * `2`, a bool indicating whether the message was transmitted (i.e. did the peer have an associated endpoint?) -pub trait Callback<T>: Fn(&T, usize, bool) -> () + Sync + Send + 'static {} +pub trait Callback<T>: Fn(&T, usize, bool) + Sync + Send + 'static {} -impl<T, F> Callback<T> for F where F: Fn(&T, usize, bool) -> () + Sync + Send + 'static {} +impl<T, F> Callback<T> for F where F: Fn(&T, usize, bool) + Sync + Send + 'static {} /// A key callback takes 1 argument /// /// * `0`, a reference to the opaque value assigned to the peer -pub trait KeyCallback<T>: Fn(&T) -> () + Sync + Send + 'static {} +pub trait KeyCallback<T>: Fn(&T) + Sync + Send + 'static {} -impl<T, F> KeyCallback<T> for F where F: Fn(&T) -> () + Sync + Send + 'static {} +impl<T, F> KeyCallback<T> for F where F: Fn(&T) + Sync + Send + 'static {} pub trait Callbacks: Send + Sync + 'static { type Opaque: Opaque; @@ -58,11 +58,11 @@ impl fmt::Display for RouterError { } impl Error for RouterError { - fn description(&self) -> &str { - "Generic Handshake Error" - } - fn source(&self) -> Option<&(dyn Error + 'static)> { None } + + fn description(&self) -> &str { + "Generic Handshake Error" + } } |