Use String::new() for empty strings.

This commit is contained in:
Stephen Chung
2022-08-21 17:35:44 +08:00
parent 248888ce0b
commit 2f02b30b6e
7 changed files with 25 additions and 27 deletions

View File

@@ -2016,7 +2016,7 @@ impl Module {
if let Some(fn_ptr) = value.downcast_ref::<crate::FnPtr>() {
if ast.iter_fn_def().any(|f| f.name == fn_ptr.fn_name()) {
return Err(crate::ERR::ErrorMismatchDataType(
"".to_string(),
String::new(),
if fn_ptr.is_anonymous() {
format!("cannot export closure in variable {_name}")
} else {