Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
address clippy & rustdoc warnings
Browse files Browse the repository at this point in the history
The comment was out of date anyway, State::Live no longer takes a
snapshot_path argument.
  • Loading branch information
Mira Ressel committed Mar 16, 2023
1 parent 0943b5f commit 2f1fc72
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/state-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ impl<BlockHash: Hash, Key: Hash, D: MetaDb> StateDbSync<BlockHash, Key, D> {
}

fn prune(&mut self, commit: &mut CommitSet<Key>) -> Result<(), Error<D::Error>> {
if let (&mut Some(ref mut pruning), &PruningMode::Constrained(ref constraints)) =
if let (&mut Some(ref mut pruning), PruningMode::Constrained(constraints)) =
(&mut self.pruning, &self.mode)
{
loop {
Expand Down
2 changes: 1 addition & 1 deletion primitives/runtime/src/offchain/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ impl Headers {
/// and collect them on your own.
pub fn find(&self, name: &str) -> Option<&str> {
let raw = name.as_bytes();
for &(ref key, ref val) in &self.raw {
for (key, val) in &self.raw {
if &**key == raw {
return str::from_utf8(val).ok()
}
Expand Down
7 changes: 2 additions & 5 deletions primitives/trie/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ mod tests {
count: 1000,
};
let mut d = st.make();
d.sort_by(|&(ref a, _), &(ref b, _)| a.cmp(b));
d.sort_by(|(a, _), (b, _)| a.cmp(b));
let dr = d.iter().map(|v| (&v.0[..], &v.1[..])).collect();
check_input(&dr);
}
Expand Down Expand Up @@ -716,10 +716,7 @@ mod tests {
t
}

fn unpopulate_trie<'db, T: TrieConfiguration>(
t: &mut TrieDBMut<'db, T>,
v: &[(Vec<u8>, Vec<u8>)],
) {
fn unpopulate_trie<T: TrieConfiguration>(t: &mut TrieDBMut<'_, T>, v: &[(Vec<u8>, Vec<u8>)]) {
for i in v {
let key: &[u8] = &i.0;
t.remove(key).unwrap();
Expand Down
2 changes: 0 additions & 2 deletions utils/frame/try-runtime/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,6 @@ pub struct LiveState {
#[derive(Debug, Clone, clap::Subcommand)]
pub enum State {
/// Use a state snapshot as the source of runtime state.
///
/// This can be crated by passing a value to [`State::Live::snapshot_path`].
Snap {
#[arg(short, long)]
snapshot_path: PathBuf,
Expand Down

0 comments on commit 2f1fc72

Please sign in to comment.