Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-mysten committed Oct 17, 2024
1 parent 307cde4 commit 68cc658
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/sui-graphql-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,20 @@ impl<T> Page<T> {

impl<T: Serialize> From<T> for Name {
fn from(value: T) -> Self {
Name {
0: bcs::to_bytes(&value).unwrap(),
}
Name(bcs::to_bytes(&value).unwrap())
}
}

impl From<BcsName> for Name {
fn from(value: BcsName) -> Self {
Name { 0: value.0 }
Name(value.0)
}
}

impl DynamicFieldOutput {
pub fn deserialize<T: DeserializeOwned>(&self) -> Result<T, anyhow::Error> {
let bcs = &self.name.bcs;
bcs::from_bytes::<T>(&bcs).map_err(|_| anyhow!("Cannot decode BCS bytes"))
bcs::from_bytes::<T>(bcs).map_err(|_| anyhow!("Cannot decode BCS bytes"))
}
}

Expand Down

0 comments on commit 68cc658

Please sign in to comment.