Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
mina86 committed Nov 20, 2023
1 parent bcbd4ee commit 3e95edd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion solana/solana-ibc/programs/solana-ibc/src/storage/ids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub trait MaybeOwned<T> {
}

impl<T: Clone> MaybeOwned<T> for &T {
fn as_ref(&self) -> &T { *self }
fn as_ref(&self) -> &T { self }
fn into_owned(self) -> T { (*self).clone() }
}

Expand Down
7 changes: 3 additions & 4 deletions solana/solana-ibc/programs/solana-ibc/src/storage/trie_key.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use ibc::path::{
use crate::storage::ibc::path::{
AckPath, CommitmentPath, ReceiptPath, SeqAckPath, SeqRecvPath, SeqSendPath,
};

use crate::storage::{ibc, ids};


Expand Down Expand Up @@ -229,13 +228,13 @@ impl AsComponent for ids::PortChannelPK {
fn key_len(&self) -> usize {
let port_id_len = self.port_id.as_bytes().len();
assert!(port_id_len <= usize::from(u8::MAX));
1 + port_id_len + u32::from(self.channel_idx).key_len()
1 + port_id_len + self.channel_idx.key_len()
}
fn append_into(&self, dest: &mut Vec<u8>) {
let port_id = self.port_id.as_bytes();
dest.push(port_id.len() as u8);
dest.extend(port_id);
u32::from(self.channel_idx).append_into(dest);
self.channel_idx.append_into(dest);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl IbcStorage<'_, '_> {
this.borrow()
.private
.next_sequence
.get(&port_channel)
.get(port_channel)
.and_then(|triple| triple.get(index))
}

Expand Down

0 comments on commit 3e95edd

Please sign in to comment.