diff --git a/packages/Cargo.lock b/packages/Cargo.lock index 274ae40..95646bc 100644 --- a/packages/Cargo.lock +++ b/packages/Cargo.lock @@ -1833,7 +1833,7 @@ dependencies = [ [[package]] name = "sidan-csl-rs" -version = "0.5.1" +version = "0.5.2" dependencies = [ "cardano-serialization-lib", "cryptoxide", @@ -2387,7 +2387,7 @@ dependencies = [ [[package]] name = "whisky" -version = "0.5.1" +version = "0.5.2" dependencies = [ "async-trait", "cardano-serialization-lib", diff --git a/packages/sidan-csl-rs/Cargo.toml b/packages/sidan-csl-rs/Cargo.toml index 9293d91..b4dc1d4 100644 --- a/packages/sidan-csl-rs/Cargo.toml +++ b/packages/sidan-csl-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sidan-csl-rs" -version = "0.5.1" +version = "0.5.2" edition = "2021" license = "Apache-2.0" description = "Wrapper around the cardano-serialization-lib for easier transaction building, heavily inspired by cardano-cli APIs" diff --git a/packages/sidan-csl-rs/src/builder/core.rs b/packages/sidan-csl-rs/src/builder/core.rs index dd05116..132662d 100644 --- a/packages/sidan-csl-rs/src/builder/core.rs +++ b/packages/sidan-csl-rs/src/builder/core.rs @@ -1,5 +1,3 @@ -use pallas_traverse::cert; - use crate::{ core::builder::{IMeshCSL, MeshCSL}, csl, diff --git a/packages/sidan-csl-rs/src/core/builder.rs b/packages/sidan-csl-rs/src/core/builder.rs index c12dc3b..0ac0efc 100644 --- a/packages/sidan-csl-rs/src/core/builder.rs +++ b/packages/sidan-csl-rs/src/core/builder.rs @@ -1,7 +1,5 @@ use std::net::{Ipv4Addr, Ipv6Addr}; -use pallas_traverse::cert; - use crate::{csl, model::*}; use super::{utils::build_tx_builder, utils::sign_transaction, utils::to_bignum, utils::to_value}; @@ -409,19 +407,17 @@ impl IMeshCSL for MeshCSL { match relay { Relay::SingleHostAddr(single_host_address_relay) => { let ipv4_bytes: Option = - single_host_address_relay.ipv4.map_or(None, |ipv4_str| { + single_host_address_relay.ipv4.map(|ipv4_str| { let addr: Ipv4Addr = ipv4_str.parse().expect("ipv4 address parse failed"); - - Some(csl::Ipv4::new(addr.octets().to_vec()).unwrap()) + csl::Ipv4::new(addr.octets().to_vec()).unwrap() }); let ipv6_bytes: Option = - single_host_address_relay.ipv6.map_or(None, |ipv6_str| { + single_host_address_relay.ipv6.map(|ipv6_str| { let addr: Ipv6Addr = ipv6_str.parse().expect("ipv6 address parse failed"); - - Some(csl::Ipv6::new(addr.octets().to_vec()).unwrap()) + csl::Ipv6::new(addr.octets().to_vec()).unwrap() }); relays.add(&csl::Relay::new_single_host_addr( &csl::SingleHostAddr::new( @@ -470,11 +466,11 @@ impl IMeshCSL for MeshCSL { .unwrap(), &pool_owners, &relays, - register_pool.pool_params.metadata.map_or(None, |data| { - Some(csl::PoolMetadata::new( + register_pool.pool_params.metadata.map(|data| { + csl::PoolMetadata::new( &csl::URL::new(data.url).unwrap(), &csl::PoolMetadataHash::from_hex(&data.hash).unwrap(), - )) + ) }), )), )) diff --git a/packages/whisky/Cargo.toml b/packages/whisky/Cargo.toml index 7fc4a15..2c6fa81 100644 --- a/packages/whisky/Cargo.toml +++ b/packages/whisky/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "whisky" -version = "0.5.1" +version = "0.5.2" edition = "2021" license = "Apache-2.0" description = "The Cardano Rust SDK, inspired by MeshJS" @@ -24,7 +24,7 @@ noop_proc_macro = "0.3.0" pallas-codec = "0.22.0" pallas-primitives = "0.22.0" pallas-traverse = "0.22.0" -sidan-csl-rs = { version = "=0.5.1", path = "../sidan-csl-rs" } +sidan-csl-rs = { version = "=0.5.2", path = "../sidan-csl-rs" } [profile.release] # Tell `rustc` to optimize for small code size.