Fix formatting.
This commit is contained in:
parent
c955c9200e
commit
5ae584fab2
@ -78,7 +78,7 @@ pub fn generate_body(
|
||||
continue;
|
||||
}
|
||||
let fn_token_name = syn::Ident::new(
|
||||
&format!("{}_token", function.name().to_string()),
|
||||
&format!("{}_token", function.name()),
|
||||
function.name().span(),
|
||||
);
|
||||
let reg_names = function.exported_names();
|
||||
@ -251,11 +251,11 @@ pub fn check_rename_collisions(fns: &[ExportedFn]) -> Result<(), syn::Error> {
|
||||
if let Some(other_span) = renames.insert(key, current_span) {
|
||||
let mut err = syn::Error::new(
|
||||
current_span,
|
||||
format!("duplicate Rhai signature for '{}'", &fn_name),
|
||||
format!("duplicate Rhai signature for '{}'", fn_name),
|
||||
);
|
||||
err.combine(syn::Error::new(
|
||||
other_span,
|
||||
format!("duplicated function renamed '{}'", &fn_name),
|
||||
format!("duplicated function renamed '{}'", fn_name),
|
||||
));
|
||||
return Err(err);
|
||||
}
|
||||
@ -263,13 +263,11 @@ pub fn check_rename_collisions(fns: &[ExportedFn]) -> Result<(), syn::Error> {
|
||||
} else {
|
||||
let ident = item_fn.name();
|
||||
if let Some(other_span) = fn_defs.insert(ident.to_string(), ident.span()) {
|
||||
let mut err = syn::Error::new(
|
||||
ident.span(),
|
||||
format!("duplicate function '{}'", ident.to_string()),
|
||||
);
|
||||
let mut err =
|
||||
syn::Error::new(ident.span(), format!("duplicate function '{}'", ident));
|
||||
err.combine(syn::Error::new(
|
||||
other_span,
|
||||
format!("duplicated function '{}'", ident.to_string()),
|
||||
format!("duplicated function '{}'", ident),
|
||||
));
|
||||
return Err(err);
|
||||
}
|
||||
@ -277,11 +275,11 @@ pub fn check_rename_collisions(fns: &[ExportedFn]) -> Result<(), syn::Error> {
|
||||
if let Some(fn_span) = renames.get(&key) {
|
||||
let mut err = syn::Error::new(
|
||||
ident.span(),
|
||||
format!("duplicate Rhai signature for '{}'", &ident),
|
||||
format!("duplicate Rhai signature for '{}'", ident),
|
||||
);
|
||||
err.combine(syn::Error::new(
|
||||
*fn_span,
|
||||
format!("duplicated function '{}'", &ident),
|
||||
format!("duplicated function '{}'", ident),
|
||||
));
|
||||
return Err(err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user