Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some clippy fixes. #1367

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion engine/src/conversion/analysis/depth_first.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ mod test {
QualifiedName::new_from_cpp_name("c"),
vec![QualifiedName::new_from_cpp_name("a")],
);
let api_list = vec![a, b, c];
let api_list = [a, b, c];
let mut it = fields_and_bases_first(api_list.iter());
assert_eq!(it.next().unwrap().0, QualifiedName::new_from_cpp_name("a"));
assert_eq!(it.next().unwrap().0, QualifiedName::new_from_cpp_name("c"));
Expand Down
13 changes: 5 additions & 8 deletions engine/src/conversion/error_reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ where
/// Run some code which generates an API. Add that API, or if
/// anything goes wrong, instead add a note of the problem in our
/// output API such that users will see documentation for the problem.
pub(crate) fn convert_apis<FF, SF, EF, TF, A, B: 'static>(
pub(crate) fn convert_apis<FF, SF, EF, TF, A, B>(
in_apis: ApiVec<A>,
out_apis: &mut ApiVec<B>,
mut func_conversion: FF,
Expand All @@ -64,7 +64,7 @@ pub(crate) fn convert_apis<FF, SF, EF, TF, A, B: 'static>(
mut typedef_conversion: TF,
) where
A: AnalysisPhase,
B: AnalysisPhase,
B: AnalysisPhase + 'static,
FF: FnMut(
ApiName,
Box<FuncToConvert>,
Expand Down Expand Up @@ -205,14 +205,11 @@ fn api_or_error<T: AnalysisPhase + 'static>(
/// a method). Add that API, or if
/// anything goes wrong, instead add a note of the problem in our
/// output API such that users will see documentation for the problem.
pub(crate) fn convert_item_apis<F, A, B: 'static>(
in_apis: ApiVec<A>,
out_apis: &mut ApiVec<B>,
mut fun: F,
) where
pub(crate) fn convert_item_apis<F, A, B>(in_apis: ApiVec<A>, out_apis: &mut ApiVec<B>, mut fun: F)
where
F: FnMut(Api<A>) -> Result<Box<dyn Iterator<Item = Api<B>>>, ConvertErrorFromCpp>,
A: AnalysisPhase,
B: AnalysisPhase,
B: AnalysisPhase + 'static,
{
out_apis.extend(in_apis.into_iter().flat_map(|api| {
let fullname = api.name_info().clone();
Expand Down
3 changes: 2 additions & 1 deletion engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,8 @@ pub fn do_cxx_cpp_generation(
cxxgen_header_name: String,
) -> Result<CppFilePair, cxx_gen::Error> {
let mut opt = cxx_gen::Opt::default();
opt.cxx_impl_annotations = cpp_codegen_options.cxx_impl_annotations.clone();
opt.cxx_impl_annotations
.clone_from(&cpp_codegen_options.cxx_impl_annotations);
let cxx_generated = cxx_gen::generate_header_and_cc(rs, &opt)?;
Ok(CppFilePair {
header: strip_system_headers(
Expand Down
Loading