feat: append validator name to handlers
This commit is contained in:
parent
b984f0455a
commit
471bbe2175
|
@ -1167,12 +1167,12 @@ impl<'a> Environment<'a> {
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn register_function(
|
fn register_function(
|
||||||
&mut self,
|
&mut self,
|
||||||
name: &'a str,
|
name: &str,
|
||||||
arguments: &[UntypedArg],
|
arguments: &[UntypedArg],
|
||||||
return_annotation: &Option<Annotation>,
|
return_annotation: &Option<Annotation>,
|
||||||
module_name: &String,
|
module_name: &String,
|
||||||
hydrators: &mut HashMap<String, Hydrator>,
|
hydrators: &mut HashMap<String, Hydrator>,
|
||||||
names: &mut HashMap<&'a str, &'a Span>,
|
names: &mut HashMap<String, &'a Span>,
|
||||||
location: &'a Span,
|
location: &'a Span,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
assert_unique_value_name(names, name, location)?;
|
assert_unique_value_name(names, name, location)?;
|
||||||
|
@ -1229,7 +1229,7 @@ impl<'a> Environment<'a> {
|
||||||
def: &'a UntypedDefinition,
|
def: &'a UntypedDefinition,
|
||||||
module_name: &String,
|
module_name: &String,
|
||||||
hydrators: &mut HashMap<String, Hydrator>,
|
hydrators: &mut HashMap<String, Hydrator>,
|
||||||
names: &mut HashMap<&'a str, &'a Span>,
|
names: &mut HashMap<String, &'a Span>,
|
||||||
kind: ModuleKind,
|
kind: ModuleKind,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
match def {
|
match def {
|
||||||
|
@ -1279,7 +1279,7 @@ impl<'a> Environment<'a> {
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
self.register_function(
|
self.register_function(
|
||||||
&handler.name,
|
&format!("{}_{}", name, handler.name),
|
||||||
&temp_params,
|
&temp_params,
|
||||||
&handler.return_annotation,
|
&handler.return_annotation,
|
||||||
module_name,
|
module_name,
|
||||||
|
@ -1297,7 +1297,7 @@ impl<'a> Environment<'a> {
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
self.register_function(
|
self.register_function(
|
||||||
&fallback.name,
|
&format!("{}_{}", name, fallback.name),
|
||||||
&temp_params,
|
&temp_params,
|
||||||
&fallback.return_annotation,
|
&fallback.return_annotation,
|
||||||
module_name,
|
module_name,
|
||||||
|
@ -1916,11 +1916,11 @@ fn assert_unique_type_name<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn assert_unique_value_name<'a>(
|
fn assert_unique_value_name<'a>(
|
||||||
names: &mut HashMap<&'a str, &'a Span>,
|
names: &mut HashMap<String, &'a Span>,
|
||||||
name: &'a str,
|
name: &str,
|
||||||
location: &'a Span,
|
location: &'a Span,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
match names.insert(name, location) {
|
match names.insert(name.to_string(), location) {
|
||||||
Some(previous_location) => Err(Error::DuplicateName {
|
Some(previous_location) => Err(Error::DuplicateName {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
previous_location: *previous_location,
|
previous_location: *previous_location,
|
||||||
|
@ -1931,11 +1931,11 @@ fn assert_unique_value_name<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn assert_unique_const_name<'a>(
|
fn assert_unique_const_name<'a>(
|
||||||
names: &mut HashMap<&'a str, &'a Span>,
|
names: &mut HashMap<String, &'a Span>,
|
||||||
name: &'a str,
|
name: &str,
|
||||||
location: &'a Span,
|
location: &'a Span,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
match names.insert(name, location) {
|
match names.insert(name.to_string(), location) {
|
||||||
Some(previous_location) => Err(Error::DuplicateConstName {
|
Some(previous_location) => Err(Error::DuplicateConstName {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
previous_location: *previous_location,
|
previous_location: *previous_location,
|
||||||
|
|
Loading…
Reference in New Issue