fix: clippy useless_conversion and useless_vec

Pull-Request: #4190.
This commit is contained in:
Benno
2023-07-16 05:31:37 +02:00
committed by GitHub
parent a3efb40892
commit 30024f38d4
7 changed files with 78 additions and 53 deletions

View File

@@ -858,7 +858,7 @@ fn test_handle_received_subscriptions() {
// UNSUBSCRIBE - Remove topic from peer_topics for peer.
// - Remove peer from topic_peers.
let topics = vec!["topic1", "topic2", "topic3", "topic4"]
let topics = ["topic1", "topic2", "topic3", "topic4"]
.iter()
.map(|&t| String::from(t))
.collect();
@@ -1280,7 +1280,7 @@ fn test_handle_graft_is_not_subscribed() {
#[test]
// tests multiple topics in a single graft message
fn test_handle_graft_multiple_topics() {
let topics: Vec<String> = vec!["topic1", "topic2", "topic3", "topic4"]
let topics: Vec<String> = ["topic1", "topic2", "topic3", "topic4"]
.iter()
.map(|&t| String::from(t))
.collect();

View File

@@ -222,7 +222,7 @@ mod test {
let t1 = TopicHash::from_raw("t1");
let t2 = TopicHash::from_raw("t2");
let old = BTreeSet::from_iter(vec![t1.clone()].into_iter());
let old = BTreeSet::from_iter(vec![t1.clone()]);
let subscriptions = vec![
Subscription {
action: Unsubscribe,