refactor(backend): implement From<UpMultihash> for Address
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
parent
127af810d2
commit
2380f0d279
3 changed files with 8 additions and 2 deletions
|
@ -221,6 +221,12 @@ impl FromStr for Address {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<UpMultihash> for Address {
|
||||||
|
fn from(hash: UpMultihash) -> Self {
|
||||||
|
Address::Hash(hash)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl fmt::Display for Address {
|
impl fmt::Display for Address {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "{}", b58_encode(self.encode().map_err(|_| fmt::Error)?))
|
write!(f, "{}", b58_encode(self.encode().map_err(|_| fmt::Error)?))
|
||||||
|
|
2
cli/src/extractors/external/monolith.rs
vendored
2
cli/src/extractors/external/monolith.rs
vendored
|
@ -66,7 +66,7 @@ impl Extractor for MonolithExtractor {
|
||||||
timestamp: chrono::Utc::now().naive_utc(),
|
timestamp: chrono::Utc::now().naive_utc(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
stored: vec![Address::Hash(stored)],
|
stored: vec![stored.into()],
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Ok(Default::default())
|
Ok(Default::default())
|
||||||
|
|
2
cli/src/extractors/external/ytdlp.rs
vendored
2
cli/src/extractors/external/ytdlp.rs
vendored
|
@ -201,7 +201,7 @@ impl Extractor for YtDlpExtractor {
|
||||||
|
|
||||||
Ok(ExtractorGetResult {
|
Ok(ExtractorGetResult {
|
||||||
entries,
|
entries,
|
||||||
stored: vec![Address::Hash(stored)],
|
stored: vec![stored.into()],
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Ok(Default::default())
|
Ok(Default::default())
|
||||||
|
|
Loading…
Reference in a new issue