Skip to content

Commit

Permalink
fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
c12i committed Jun 24, 2024
1 parent 9ab00f3 commit 42979fa
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/scaffold/app/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::error::ScaffoldResult;

pub fn setup_git_environment<P: AsRef<Path>>(path: P) -> ScaffoldResult<()> {
if let Err(e) = (|| {
let repo = Repository::init_opts(path, &RepositoryInitOptions::new().initial_head("main"))?;
let repo = Repository::init_opts(path, RepositoryInitOptions::new().initial_head("main"))?;
let mut index = repo.index()?;
index.add_all(["*"].iter(), IndexAddOption::DEFAULT, None)?;
index.write()?;
Expand Down
2 changes: 1 addition & 1 deletion src/scaffold/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub fn scaffold_collection(
)?;

let collection_type = match maybe_collection_type {
Some(t) => Ok(t.clone()),
Some(t) => Ok(t),
None => choose_collection_type(),
}?;

Expand Down
2 changes: 1 addition & 1 deletion src/scaffold/dna/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn new_coordinator_zome_manifest(
hash: None,
location,
dependencies: maybe_dependencies.map(|dz| {
dz.into_iter()
dz.iter()
.map(|d| ZomeDependency {
name: d.to_owned().into(),
})
Expand Down
2 changes: 1 addition & 1 deletion src/scaffold/entry_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn scaffold_entry_type(
let reference_entry_hash = maybe_reference_entry_hash.unwrap_or(false);

let crud = match maybe_crud {
Some(c) => c.clone(),
Some(c) => c,
None => choose_crud(),
};

Expand Down
4 changes: 2 additions & 2 deletions src/scaffold/web_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn scaffold_web_app(
template_file_tree: &FileTree,
holo_enabled: bool,
) -> ScaffoldResult<ScaffoldedTemplate> {
check_for_reserved_words(&app_name)?;
check_for_reserved_words(app_name)?;

let mut app_file_tree = dir! {
".gitignore" => file!(gitignore())
Expand All @@ -43,7 +43,7 @@ pub fn scaffold_web_app(
}

let scaffold_template_result =
scaffold_web_app_template(app_file_tree, template_file_tree, &app_name, holo_enabled)?;
scaffold_web_app_template(app_file_tree, template_file_tree, app_name, holo_enabled)?;

Ok(scaffold_template_result)
}
2 changes: 1 addition & 1 deletion src/templates/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn scaffold_collection_templates(
dna_role_name: dna_role_name.to_owned(),
coordinator_zome_manifest: coordinator_zome_manifest.clone(),
collection_name: collection_name.to_owned(),
collection_type: collection_type.clone(),
collection_type: *collection_type,
referenceable: Referenceable::EntryType(entry_type_reference.clone()),
deletable,
};
Expand Down
2 changes: 1 addition & 1 deletion src/templates/entry_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn scaffold_entry_type_templates(
coordinator_zome_manifest: coordinator_zome.clone(),
entry_type: entry_type.clone(),
entry_type_ts_types,
crud: crud.clone(),
crud: *crud,
link_from_original_to_each_update,
};
let h = build_handlebars(template_file_tree)?;
Expand Down

0 comments on commit 42979fa

Please sign in to comment.