We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 239705f commit f69ddd8Copy full SHA for f69ddd8
src/multihasher.rs
@@ -1,5 +1,5 @@
1
use std::collections::VecDeque;
2
-use std::fmt;
+use std::fmt::{self, Display};
3
4
use async_trait::async_trait;
5
use libp2p_core::multihash::Multihash;
@@ -39,6 +39,16 @@ pub enum MultihasherError {
39
CustomFatal(String),
40
}
41
42
+impl MultihasherError {
43
+ pub fn custom(e: impl Display) -> MultihasherError {
44
+ MultihasherError::Custom(e.to_string())
45
+ }
46
+
47
+ pub fn custom_fatal(e: impl Display) -> MultihasherError {
48
+ MultihasherError::CustomFatal(e.to_string())
49
50
+}
51
52
/// Trait for producing a custom [`Multihash`].
53
#[async_trait]
54
pub trait Multihasher<const S: usize> {
0 commit comments