From 622e92f275ff642d7272be045f865e27eb5313db Mon Sep 17 00:00:00 2001 From: chunningham Date: Thu, 6 Apr 2023 20:25:10 +1000 Subject: [PATCH] satisfy clippy again --- src/p2p/relay.rs | 45 -------------------------------------------- src/storage/s3.rs | 4 ++-- src/storage/utils.rs | 1 - 3 files changed, 2 insertions(+), 48 deletions(-) diff --git a/src/p2p/relay.rs b/src/p2p/relay.rs index 841c07d7..ae4b3da0 100644 --- a/src/p2p/relay.rs +++ b/src/p2p/relay.rs @@ -273,49 +273,4 @@ mod test { assert_eq!(listened, vec![addr]); } - - #[test] - async fn can_relay() { - let mut alice = Config::default() - .launch(Keypair::generate_ed25519(), MemoryConfig) - .unwrap(); - - let mut bob = Config::default() - .launch( - Keypair::generate_ed25519(), - Both::::default(), - ) - .unwrap(); - - let mut charles = Config::default() - .launch( - Keypair::generate_ed25519(), - Both::::default(), - ) - .unwrap(); - - alice - .listen_on([build_multiaddr!(Memory(0u8))]) - .await - .unwrap(); - - bob.listen_on([build_multiaddr!(Memory(0u8))]) - .await - .unwrap(); - - charles - .listen_on([build_multiaddr!(Tcp(0u8))]) - .await - .unwrap(); - - let alice_addrs = alice.get_addresses().await.unwrap(); - let bob_addrs = bob.get_addresses().await.unwrap(); - let charles_addrs = charles.get_addresses().await.unwrap(); - - let charles_via_bob = bob_addrs[0].clone().with(Protocol::P2p(bob.id().into())); - - let charles_via_bob = charles_addrs[0].with(Protocol::P2p(bob.id().into())); - - alice.dial().await.unwrap(); - } } diff --git a/src/storage/s3.rs b/src/storage/s3.rs index 8036c623..d4374b5c 100644 --- a/src/storage/s3.rs +++ b/src/storage/s3.rs @@ -100,7 +100,7 @@ impl ProviderUtils for S3BlockConfig { .await { Ok(o) => Ok(Keypair::from_protobuf_encoding( - &o.body.collect().await?.into_bytes().to_vec(), + &o.body.collect().await?.into_bytes(), )?), Err(SdkError::ServiceError { err: @@ -132,7 +132,7 @@ impl ProviderUtils for S3BlockConfig { .await { Ok(o) => Ok(Some(Keypair::from_protobuf_encoding( - &o.body.collect().await?.into_bytes().to_vec(), + &o.body.collect().await?.into_bytes(), )?)), Err(SdkError::ServiceError { err: diff --git a/src/storage/utils.rs b/src/storage/utils.rs index d40560e9..800d20f5 100644 --- a/src/storage/utils.rs +++ b/src/storage/utils.rs @@ -53,7 +53,6 @@ macro_rules! write_with_multihash { let (mut h, b) = hb.into_inner(); Ok((Code::$hashes.wrap(h.finalize())?, b)) },)* - _ => Err(MultihashError::UnsupportedCode($code.into())), } }; }