Skip to content

Commit

Permalink
Add some context to the [None] option when scaffolding a link-type
Browse files Browse the repository at this point in the history
  • Loading branch information
c12i committed Oct 15, 2024
1 parent ec56ad9 commit 6d3c514
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/scaffold/entry_type/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ pub fn choose_optional_referenceable(
all_entries: &[EntryTypeReference],
prompt: &str,
) -> ScaffoldResult<Option<Referenceable>> {
inner_choose_referenceable(all_entries, prompt, Some(vec!["[None]"]))
inner_choose_referenceable(
all_entries,
prompt,
Some(vec!["[None] (Use this link to attach meta-data only)"]),
)
}

fn inner_choose_referenceable(
Expand Down Expand Up @@ -136,11 +140,11 @@ fn inner_choose_referenceable(
)?;
Ok(Some(Referenceable::ExternalHash { name }))
}
"[None]" => Ok(None),
entry_type if entry_type.starts_with("[None]") => Ok(None),
entry_type => Ok(Some(Referenceable::EntryType(EntryTypeReference {
entry_type: entry_type.to_owned(),
reference_entry_hash: choose_reference_entry_hash(
&String::from("Reference this entry type with its entry hash or its action hash?"),
"Reference this entry type with its entry hash or its action hash?",
all_entries[selection].reference_entry_hash,
)?,
}))),
Expand Down

0 comments on commit 6d3c514

Please sign in to comment.