Skip to content

Commit 3b678cf

Browse files
committed
Some clippy fixes.
1 parent 5e6673d commit 3b678cf

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

engine/src/conversion/analysis/depth_first.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ mod test {
105105
QualifiedName::new_from_cpp_name("c"),
106106
vec![QualifiedName::new_from_cpp_name("a")],
107107
);
108-
let api_list = vec![a, b, c];
108+
let api_list = [a, b, c];
109109
let mut it = fields_and_bases_first(api_list.iter());
110110
assert_eq!(it.next().unwrap().0, QualifiedName::new_from_cpp_name("a"));
111111
assert_eq!(it.next().unwrap().0, QualifiedName::new_from_cpp_name("c"));

engine/src/conversion/error_reporter.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ where
5555
/// Run some code which generates an API. Add that API, or if
5656
/// anything goes wrong, instead add a note of the problem in our
5757
/// output API such that users will see documentation for the problem.
58-
pub(crate) fn convert_apis<FF, SF, EF, TF, A, B: 'static>(
58+
pub(crate) fn convert_apis<FF, SF, EF, TF, A, B>(
5959
in_apis: ApiVec<A>,
6060
out_apis: &mut ApiVec<B>,
6161
mut func_conversion: FF,
@@ -64,7 +64,7 @@ pub(crate) fn convert_apis<FF, SF, EF, TF, A, B: 'static>(
6464
mut typedef_conversion: TF,
6565
) where
6666
A: AnalysisPhase,
67-
B: AnalysisPhase,
67+
B: AnalysisPhase + 'static,
6868
FF: FnMut(
6969
ApiName,
7070
Box<FuncToConvert>,
@@ -205,14 +205,11 @@ fn api_or_error<T: AnalysisPhase + 'static>(
205205
/// a method). Add that API, or if
206206
/// anything goes wrong, instead add a note of the problem in our
207207
/// output API such that users will see documentation for the problem.
208-
pub(crate) fn convert_item_apis<F, A, B: 'static>(
209-
in_apis: ApiVec<A>,
210-
out_apis: &mut ApiVec<B>,
211-
mut fun: F,
212-
) where
208+
pub(crate) fn convert_item_apis<F, A, B>(in_apis: ApiVec<A>, out_apis: &mut ApiVec<B>, mut fun: F)
209+
where
213210
F: FnMut(Api<A>) -> Result<Box<dyn Iterator<Item = Api<B>>>, ConvertErrorFromCpp>,
214211
A: AnalysisPhase,
215-
B: AnalysisPhase,
212+
B: AnalysisPhase + 'static,
216213
{
217214
out_apis.extend(in_apis.into_iter().flat_map(|api| {
218215
let fullname = api.name_info().clone();

engine/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,8 @@ pub fn do_cxx_cpp_generation(
604604
cxxgen_header_name: String,
605605
) -> Result<CppFilePair, cxx_gen::Error> {
606606
let mut opt = cxx_gen::Opt::default();
607-
opt.cxx_impl_annotations = cpp_codegen_options.cxx_impl_annotations.clone();
607+
opt.cxx_impl_annotations
608+
.clone_from(&cpp_codegen_options.cxx_impl_annotations);
608609
let cxx_generated = cxx_gen::generate_header_and_cc(rs, &opt)?;
609610
Ok(CppFilePair {
610611
header: strip_system_headers(

0 commit comments

Comments
 (0)