Use identifiers in format!

This commit is contained in:
Stephen Chung
2022-08-11 19:01:23 +08:00
parent ceaf9fab1b
commit be448dfe4d
36 changed files with 164 additions and 206 deletions

View File

@@ -30,7 +30,7 @@ mod string_functions {
if s.is_empty() {
string.clone()
} else {
format!("{}{}", string, s).into()
format!("{string}{s}").into()
}
}
#[rhai_fn(name = "+=", name = "append")]
@@ -38,7 +38,7 @@ mod string_functions {
let s = print_with_func(FUNC_TO_STRING, &ctx, &mut item);
if !s.is_empty() {
*string = format!("{}{}", string, s).into();
*string = format!("{string}{s}").into();
}
}
#[rhai_fn(name = "+", pure)]
@@ -68,7 +68,7 @@ mod string_functions {
}
#[rhai_fn(name = "+")]
pub fn add_prepend_char(character: char, string: &str) -> ImmutableString {
format!("{}{}", character, string).into()
format!("{character}{string}").into()
}
#[rhai_fn(name = "+")]