Skip to content

Commit

Permalink
chore: prefix => label
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Dec 8, 2024
1 parent fd4e9c4 commit c6a9593
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions promkit-derive/examples/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ use promkit_derive::Promkit;
#[derive(Default, Debug, Promkit)]
struct Profile {
#[form(
prefix = "What is your name?",
prefix_style = StyleBuilder::new().fgc(Color::DarkCyan).build(),
label = "What is your name?",
label_style = StyleBuilder::new().fgc(Color::DarkCyan).build(),
)]
name: String,

#[form(default)]
hobby: Option<String>,

#[form(prefix = "How old are you?", ignore_invalid_attr = "nothing")]
#[form(label = "How old are you?", ignore_invalid_attr = "nothing")]
age: usize,
}

Expand Down
4 changes: 2 additions & 2 deletions promkit-derive/src/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ pub fn create_state(attr: &syn::Attribute) -> Result<TokenStream, Error> {
.into_iter()
.for_each(
|entry| match entry.path.get_ident().unwrap().to_string().as_str() {
"prefix" => {
"label" => {
let expr = entry.value;
prefix = quote! { format!("{} ", #expr) };
}
"prefix_style" => {
"label_style" => {
let expr = entry.value;
prefix_style = quote! { #expr };
}
Expand Down

0 comments on commit c6a9593

Please sign in to comment.