Skip to content

Commit

Permalink
Fix misplaced doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
c12i committed Nov 5, 2024
1 parent f2ef3bb commit 724389f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/scaffold/entry_type/integrity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pub fn render_entry_definition_file(

let validate_update_result = if crud.update {
quote! {
/// TODO: add the appropriate validation rules
// TODO: add the appropriate validation rules
Ok(ValidateCallbackResult::Valid)
}
} else {
Expand All @@ -236,7 +236,7 @@ pub fn render_entry_definition_file(

let validate_delete_result = if crud.delete {
quote! {
/// TODO: add the appropriate validation rules
// TODO: add the appropriate validation rules
Ok(ValidateCallbackResult::Valid)
}
} else {
Expand Down Expand Up @@ -339,7 +339,7 @@ pub fn render_entry_definition_file(
) -> ExternResult<ValidateCallbackResult> {
#(#deps_validation)*

/// TODO: add the appropriate validation rules
// TODO: add the appropriate validation rules
Ok(ValidateCallbackResult::Valid)
}

Expand Down
4 changes: 2 additions & 2 deletions src/scaffold/link_type/integrity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,15 @@ fn validate_referenceable(

if entry_type.reference_entry_hash {
quote! {
/// Check the entry type for the given entry hash
// Check the entry type for the given entry hash
let entry_hash = #address_ident.into_entry_hash().ok_or(wasm_error!(WasmErrorInner::Guest("No entry hash associated with link".to_string())))?;
let entry = must_get_entry(entry_hash)?.content;

let #entry_type_snake = crate::#entry_type_pascal::try_from(entry)?;
}
} else {
quote! {
/// Check the entry type for the given action hash
// Check the entry type for the given action hash
let action_hash = #address_ident.into_action_hash().ok_or(wasm_error!(
WasmErrorInner::Guest("No action hash associated with link".to_string())
))?;
Expand Down
2 changes: 1 addition & 1 deletion src/scaffold/zome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ pub fn scaffold_coordinator_zome_in_path(
let file_tree = add_common_zome_dependencies_to_workspace_cargo(dna_file_tree.file_tree())?;
let mut file_tree = add_workspace_path_dependency(file_tree, zome_name, &path.join(zome_name))?;

let initial_lib_rs = &coordinator::initial_lib_rs(dependencies);
let initial_lib_rs = coordinator::initial_lib_rs(dependencies);

let zome: FileTree = dir! {
"Cargo.toml" => file!(coordinator::initial_cargo_toml(zome_name, dependencies)),
Expand Down
2 changes: 1 addition & 1 deletion src/scaffold/zome/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ pub fn initial_lib_rs(dependencies: Option<&Vec<String>>) -> TokenStream {
pub enum Signal {}

/// Whenever an action is committed, we emit a signal to the UI elements to reactively update them
/// Don't modify the for loop if you want the scaffolding tool to generate appropriate signals for your entries and links
#[hdk_extern(infallible)]
pub fn post_commit(committed_actions: Vec<SignedActionHashed>) {
/// Don't modify this loop if you want the scaffolding tool to generate appropriate signals for your entries and links
for action in committed_actions {
if let Err(err) = signal_action(action) {
error!("Error signaling new action: {:?}", err);
Expand Down
20 changes: 8 additions & 12 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,16 @@ fn get_folder_names(folder: &BTreeMap<OsString, FileTree>) -> Vec<String> {
#[inline]
/// "yes" or "no" input dialog, with the option to specify a recommended answer (yes = true, no = false)
pub fn input_yes_or_no(prompt: &str, recommended: Option<bool>) -> ScaffoldResult<bool> {
let yes_recommended = if recommended == Some(true) {
" (recommended)"
} else {
""
};
let no_recommended = if recommended == Some(false) {
" (recommended)"
} else {
""
};
let yes_recommended = (recommended == Some(true))
.then_some("(recommended)")
.unwrap_or_default();
let no_recommended = (recommended == Some(false))
.then_some("(recommended)")
.unwrap_or_default();

let items = [
format!("Yes{}", yes_recommended),
format!("No{}", no_recommended),
format!("Yes {}", yes_recommended),
format!("No {}", no_recommended),
];

let selection = Select::with_theme(&ColorfulTheme::default())
Expand Down

0 comments on commit 724389f

Please sign in to comment.