Skip to content

Commit

Permalink
rename methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Nov 21, 2024
1 parent 4de4c9b commit 13b1e10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn derive_expr(input: TokenStream) -> TokenStream {
let field_name_str = field_name.as_ref().unwrap().to_string();
quote! {
pub fn #field_name(&self) -> Expr<#field_type> {
self.get::<#field_type>(#field_name_str)
self.select::<#field_type>(#field_name_str)
}
}
});
Expand Down
8 changes: 4 additions & 4 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use gh_workflow_macros::Expr;
enum Step {
#[default]
Root,
Get {
Select {
name: String,
object: Box<Step>,
},
Expand All @@ -22,10 +22,10 @@ impl<A> Expr<A> {
Expr { marker: PhantomData, step: Step::Root }
}

fn get<B>(&self, path: impl Into<String>) -> Expr<B> {
fn select<B>(&self, path: impl Into<String>) -> Expr<B> {
Expr {
marker: PhantomData,
step: Step::Get { name: path.into(), object: Box::new(self.step.clone()) },
step: Step::Select { name: path.into(), object: Box::new(self.step.clone()) },
}
}
}
Expand All @@ -37,7 +37,7 @@ impl<A> ToString for Expr<A> {
loop {
match step {
Step::Root => break,
Step::Get { name, object } => {
Step::Select { name, object } => {
parts.push(name.clone());
step = object;
}
Expand Down

0 comments on commit 13b1e10

Please sign in to comment.