Fix formatting.

This commit is contained in:
Stephen Chung 2021-10-23 12:28:42 +08:00
parent 07181feacf
commit a51482e9c8

View File

@ -80,7 +80,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();
@ -262,11 +262,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);
}
@ -274,13 +274,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);
}
@ -288,11 +286,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);
}