Skip to content

Commit

Permalink
Use better name of those helpers.
Browse files Browse the repository at this point in the history
Signed-off-by: Hiram Chirino <[email protected]>
  • Loading branch information
chirino committed Jul 9, 2024
1 parent b8f92ce commit 9a9d4ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions interpreter/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ mod tests {

impl ParcDynamicCollection<Species> for Species {
fn resolver(receiver: Parc<Species>) -> MemberResolver {
MemberResolver::new_attribute_handler(move |attribute| match attribute.as_str() {
MemberResolver::attribute_handler(move |attribute| match attribute.as_str() {
"name" => Some(receiver.name.clone().into()),
"language" => Some(receiver.language.clone().into()),
"homeworld" => Some(receiver.homeworld.clone().into()),
Expand All @@ -821,7 +821,7 @@ mod tests {

impl ParcDynamicCollection<Character> for Character {
fn resolver(receiver: Parc<Character>) -> MemberResolver {
MemberResolver::new_attribute_handler(move |attribute| match attribute.as_str() {
MemberResolver::attribute_handler(move |attribute| match attribute.as_str() {
"name" => Some(receiver.name.clone().into()),
"gender" => Some(receiver.gender.clone().into()),
"species" => Some(receiver.project(|receiver| &receiver.species).into()),
Expand All @@ -839,7 +839,7 @@ mod tests {

impl ParcDynamicCollection<Film> for Film {
fn resolver(receiver: Parc<Film>) -> MemberResolver {
MemberResolver::new_attribute_handler(move |attribute| match attribute.as_str() {
MemberResolver::attribute_handler(move |attribute| match attribute.as_str() {
"director" => Some(receiver.director.clone().into()),
"title" => Some(receiver.title.clone().into()),
"characters" => Some(receiver.project(|receiver| &receiver.characters).into()),
Expand Down
4 changes: 2 additions & 2 deletions interpreter/src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl MemberResolver {
}
}

pub fn new_attribute_handler<F>(handler: F) -> Self
pub fn attribute_handler<F>(handler: F) -> Self
where
F: Fn(Arc<String>) -> Option<Value> + Sync + Send + 'static,
{
Expand All @@ -187,7 +187,7 @@ impl MemberResolver {
})
}

pub fn new_index_handler<F>(handler: F) -> Self
pub fn index_handler<F>(handler: F) -> Self
where
F: Fn(Value) -> Option<Value> + Sync + Send + 'static,
{
Expand Down

0 comments on commit 9a9d4ba

Please sign in to comment.