chore(clippy): make clippy happy (#2597)

This commit is contained in:
Matthias Seitz
2023-05-07 12:00:23 +02:00
committed by GitHub
parent 3591a6f249
commit 523ffa0cb7
6 changed files with 8 additions and 12 deletions

View File

@@ -110,11 +110,7 @@ impl tokio_util::codec::Decoder for StreamCodec {
} else if is_whitespace(byte) {
whitespaces += 1;
}
if byte == b'\\' && !is_escaped && in_str {
is_escaped = true;
} else {
is_escaped = false;
}
is_escaped = byte == b'\\' && !is_escaped && in_str;
if depth == 0 && idx != start_idx && idx - start_idx + 1 > whitespaces {
let bts = buf.split_to(idx + 1);

View File

@@ -104,7 +104,7 @@ pub fn test_rpc_builder() -> RpcModuleBuilder<
RpcModuleBuilder::default()
.with_client(NoopProvider::default())
.with_pool(testing_pool())
.with_network(NoopNetwork::default())
.with_network(NoopNetwork)
.with_executor(TokioTaskExecutor::default())
.with_events(TestCanonStateSubscriptions::default())
}

View File

@@ -373,7 +373,7 @@ mod tests {
let eth_api = EthApi::new(
NoopProvider::default(),
testing_pool(),
NoopNetwork::default(),
NoopNetwork,
EthStateCache::spawn(NoopProvider::default(), Default::default()),
);
@@ -457,7 +457,7 @@ mod tests {
let eth_api = EthApi::new(
mock_provider,
testing_pool(),
NoopNetwork::default(),
NoopNetwork,
EthStateCache::spawn(NoopProvider::default(), Default::default()),
);

View File

@@ -765,7 +765,7 @@ mod tests {
#[tokio::test]
async fn send_raw_transaction() {
let noop_provider = NoopProvider::default();
let noop_network_provider = NoopNetwork::default();
let noop_network_provider = NoopNetwork;
let pool = testing_pool();

View File

@@ -43,6 +43,6 @@ impl<T: PoolTransaction> TransactionValidator for NoopTransactionValidator<T> {
impl<T> Default for NoopTransactionValidator<T> {
fn default() -> Self {
NoopTransactionValidator(PhantomData::default())
NoopTransactionValidator(PhantomData)
}
}

View File

@@ -38,7 +38,7 @@ impl<'a, K: Key + From<Vec<u8>>, C: TrieCursor<K>> TrieWalker<'a, K, C> {
stack: vec![CursorSubNode::default()],
can_skip_current_node: false,
trie_updates: None,
__phantom: PhantomData::default(),
__phantom: PhantomData,
};
// Set up the root node of the trie in the stack, if it exists.
@@ -59,7 +59,7 @@ impl<'a, K: Key + From<Vec<u8>>, C: TrieCursor<K>> TrieWalker<'a, K, C> {
stack,
can_skip_current_node: false,
trie_updates: None,
__phantom: PhantomData::default(),
__phantom: PhantomData,
};
this.update_skip_node();
this