Skip to content

address clippy issues from 1.66.0 #1178

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

Merged
merged 1 commit into from
Dec 16, 2022
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 services/autorust/codegen/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn gen_crate(package_name: &str, spec: &SpecReadme, run_config: &RunConfig,
let mut has_xml = false;
for tag in tags {
println!(" {}", tag.name());
let output_folder = io::join(&src_folder, &tag.rust_mod_name())?;
let output_folder = io::join(&src_folder, tag.rust_mod_name())?;
let input_files: Result<Vec<_>> = tag
.input_files()
.iter()
Expand Down
4 changes: 2 additions & 2 deletions services/autorust/codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ pub fn run<'a>(crate_config: &'a CrateConfig, package_config: &'a PackageConfig)
if crate_config.should_run(&Runs::Models) {
let models = codegen_models::create_models(&cg)?;
let models_path = io::join(&crate_config.output_folder, "models.rs")?;
write_file(&models_path, &models, crate_config.print_writing_file())?;
write_file(models_path, &models, crate_config.print_writing_file())?;
}

// create api client from operations
if crate_config.should_run(&Runs::Operations) {
let operations = codegen_operations::create_operations(&cg)?;
let operations_path = io::join(&crate_config.output_folder, "mod.rs")?;
write_file(&operations_path, &operations, crate_config.print_writing_file())?;
write_file(operations_path, &operations, crate_config.print_writing_file())?;
}

Ok(cg)
Expand Down
6 changes: 3 additions & 3 deletions services/autorust/codegen/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl Spec {
let ref_files = openapi::get_reference_file_paths(file_path, &doc);
docs.insert(Utf8PathBuf::from(file_path), doc);
for ref_file in ref_files {
let child_path = io::join(file_path, &ref_file)?;
let child_path = io::join(file_path, ref_file)?;
Self::read_file(docs, &child_path)?;
}
}
Expand Down Expand Up @@ -189,7 +189,7 @@ impl Spec {
let doc_file = doc_file.as_ref();
let full_path = match reference.file {
None => doc_file.to_owned(),
Some(file) => io::join(doc_file, &file)?,
Some(file) => io::join(doc_file, file)?,
};
let name = reference.name.ok_or_else(|| Error::message(ErrorKind::Parse, "no name in ref"))?;
let ref_key = RefKey {
Expand Down Expand Up @@ -223,7 +223,7 @@ impl Spec {
let mut resolved = IndexMap::new();
let doc_file = doc_file.into();
for (name, schema) in ref_or_schemas {
resolved.insert(name.clone(), self.resolve_schema(&doc_file, schema)?);
resolved.insert(name.clone(), self.resolve_schema(doc_file.clone(), schema)?);
}
Ok(resolved)
}
Expand Down