Skip to content

Commit 0d29dde

Browse files
committed
chore: address clippy warnings
Signed-off-by: Roman Volosatovs <[email protected]>
1 parent 62c13b2 commit 0d29dde

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

crates/wit-bindgen-rust/tests/codegen.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ mod skip {
104104

105105
let invocations = serve(wrpc, Component).await.unwrap();
106106
let invocations = std::thread::spawn(|| invocations).join().unwrap();
107-
invocations.into_iter().for_each(|(instance, name, st)| {
107+
for (instance, name, st) in invocations {
108108
wit_bindgen_wrpc::tokio::spawn(async move {
109109
eprintln!("serving {instance} {name}");
110110
st.try_collect::<Vec<_>>().await.unwrap();
111111
});
112-
})
112+
}
113113
}
114114
}
115115

@@ -175,12 +175,12 @@ mod symbol_does_not_conflict {
175175

176176
let invocations = serve(wrpc, Component).await.unwrap();
177177
let invocations = std::thread::spawn(|| invocations).join().unwrap();
178-
invocations.into_iter().for_each(|(instance, name, st)| {
178+
for (instance, name, st) in invocations {
179179
wit_bindgen_wrpc::tokio::spawn(async move {
180180
eprintln!("serving {instance} {name}");
181181
st.try_collect::<Vec<_>>().await.unwrap();
182182
});
183-
})
183+
}
184184
}
185185
}
186186

@@ -210,12 +210,12 @@ mod alternative_bitflags_path {
210210

211211
let invocations = serve(wrpc, Component).await.unwrap();
212212
let invocations = std::thread::spawn(|| invocations).join().unwrap();
213-
invocations.into_iter().for_each(|(instance, name, st)| {
213+
for (instance, name, st) in invocations {
214214
wit_bindgen_wrpc::tokio::spawn(async move {
215215
eprintln!("serving {instance} {name}");
216216
st.try_collect::<Vec<_>>().await.unwrap();
217217
});
218-
})
218+
}
219219
}
220220

221221
impl<Ctx: Send> Handler<Ctx> for Component {
@@ -276,12 +276,12 @@ mod owned_resource_deref_mut {
276276

277277
let invocations = serve(wrpc, Component).await.unwrap();
278278
let invocations = std::thread::spawn(|| invocations).join().unwrap();
279-
invocations.into_iter().for_each(|(instance, name, st)| {
279+
for (instance, name, st) in invocations {
280280
wit_bindgen_wrpc::tokio::spawn(async move {
281281
eprintln!("serving {instance} {name}");
282282
st.try_collect::<Vec<_>>().await.unwrap();
283283
});
284-
})
284+
}
285285
}
286286
}
287287

@@ -324,12 +324,12 @@ mod package_with_versions {
324324

325325
let invocations = serve(wrpc, Component).await.unwrap();
326326
let invocations = std::thread::spawn(|| invocations).join().unwrap();
327-
invocations.into_iter().for_each(|(instance, name, st)| {
327+
for (instance, name, st) in invocations {
328328
wit_bindgen_wrpc::tokio::spawn(async move {
329329
eprintln!("serving {instance} {name}");
330330
st.try_collect::<Vec<_>>().await.unwrap();
331331
});
332-
})
332+
}
333333
}
334334
}
335335

@@ -384,12 +384,12 @@ mod custom_derives {
384384

385385
let invocations = serve(wrpc, Component).await.unwrap();
386386
let invocations = std::thread::spawn(|| invocations).join().unwrap();
387-
invocations.into_iter().for_each(|(instance, name, st)| {
387+
for (instance, name, st) in invocations {
388388
wit_bindgen_wrpc::tokio::spawn(async move {
389389
eprintln!("serving {instance} {name}");
390390
st.try_collect::<Vec<_>>().await.unwrap();
391391
});
392-
})
392+
}
393393
}
394394
}
395395

@@ -640,12 +640,12 @@ mod interface_export_example {
640640

641641
let invocations = serve(wrpc, MyComponent).await.unwrap();
642642
let invocations = std::thread::spawn(|| invocations).join().unwrap();
643-
invocations.into_iter().for_each(|(instance, name, st)| {
643+
for (instance, name, st) in invocations {
644644
wit_bindgen_wrpc::tokio::spawn(async move {
645645
eprintln!("serving {instance} {name}");
646646
st.try_collect::<Vec<_>>().await.unwrap();
647647
});
648-
})
648+
}
649649
}
650650
}
651651
#[allow(unused)]
@@ -722,7 +722,7 @@ mod resource_example {
722722
if level as u32 <= *logger.level.read().unwrap() as u32 {
723723
let mut contents = logger.contents.write().unwrap();
724724
contents.push_str(&msg);
725-
contents.push_str("\n");
725+
contents.push('\n');
726726
}
727727
Ok(())
728728
}
@@ -733,7 +733,7 @@ mod resource_example {
733733
let loggers = self.loggers.read().unwrap();
734734
let logger = loggers.get(i).context("invalid resource handle")?;
735735
let level = logger.level.read().unwrap();
736-
Ok(level.clone())
736+
Ok(*level)
737737
}
738738

739739
async fn set_level(
@@ -756,12 +756,12 @@ mod resource_example {
756756

757757
let invocations = serve(wrpc, MyComponent::default()).await.unwrap();
758758
let invocations = std::thread::spawn(|| invocations).join().unwrap();
759-
invocations.into_iter().for_each(|(instance, name, st)| {
759+
for (instance, name, st) in invocations {
760760
tokio::spawn(async move {
761761
eprintln!("serving {instance} {name}");
762762
st.try_collect::<Vec<_>>().await.unwrap();
763763
});
764-
})
764+
}
765765
}
766766
}
767767

0 commit comments

Comments
 (0)