Use identifiers in format!
This commit is contained in:
@@ -82,7 +82,7 @@ impl Engine {
|
||||
let sep = crate::tokenizer::Token::DoubleColon.literal_syntax();
|
||||
|
||||
Err(ERR::ErrorVariableNotFound(
|
||||
format!("{}{}{}", namespace, sep, var_name),
|
||||
format!("{namespace}{sep}{var_name}"),
|
||||
namespace.position(),
|
||||
)
|
||||
.into())
|
||||
@@ -106,7 +106,7 @@ impl Engine {
|
||||
let sep = crate::tokenizer::Token::DoubleColon.literal_syntax();
|
||||
|
||||
return Err(ERR::ErrorVariableNotFound(
|
||||
format!("{}{}{}", namespace, sep, var_name),
|
||||
format!("{namespace}{sep}{var_name}"),
|
||||
namespace.position(),
|
||||
)
|
||||
.into());
|
||||
@@ -496,7 +496,7 @@ impl Engine {
|
||||
// The key should exist, unless the AST is compiled in a different Engine
|
||||
let custom_def = self.custom_syntax.get(key_token).ok_or_else(|| {
|
||||
Box::new(ERR::ErrorCustomSyntax(
|
||||
format!("Invalid custom syntax prefix: {}", key_token),
|
||||
format!("Invalid custom syntax prefix: {key_token}"),
|
||||
custom.tokens.iter().map(<_>::to_string).collect(),
|
||||
*pos,
|
||||
))
|
||||
|
@@ -642,7 +642,7 @@ impl Engine {
|
||||
#[cfg(not(feature = "unchecked"))]
|
||||
if x > INT::MAX as usize {
|
||||
loop_result = Err(ERR::ErrorArithmetic(
|
||||
format!("for-loop counter overflow: {}", x),
|
||||
format!("for-loop counter overflow: {x}"),
|
||||
counter.pos,
|
||||
)
|
||||
.into());
|
||||
|
Reference in New Issue
Block a user