mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-06 05:24:42 -04:00
Import anyhow::Result across the codebase
There is no need to fully qualify this type because it is a type alias for std::Result. We can mix and match the two as we want.
This commit is contained in:
parent
519d1a5701
commit
b47b06aa23
11 changed files with 21 additions and 17 deletions
|
@ -65,7 +65,7 @@ impl Database {
|
|||
.context("Could not flush db")
|
||||
}
|
||||
|
||||
pub fn get_state(&self, swap_id: Uuid) -> anyhow::Result<Swap> {
|
||||
pub fn get_state(&self, swap_id: Uuid) -> Result<Swap> {
|
||||
let key = serialize(&swap_id)?;
|
||||
|
||||
let encoded = self
|
||||
|
@ -97,14 +97,14 @@ impl Database {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn serialize<T>(t: &T) -> anyhow::Result<Vec<u8>>
|
||||
pub fn serialize<T>(t: &T) -> Result<Vec<u8>>
|
||||
where
|
||||
T: Serialize,
|
||||
{
|
||||
Ok(serde_cbor::to_vec(t)?)
|
||||
}
|
||||
|
||||
pub fn deserialize<T>(v: &[u8]) -> anyhow::Result<T>
|
||||
pub fn deserialize<T>(v: &[u8]) -> Result<T>
|
||||
where
|
||||
T: DeserializeOwned,
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue