Use identifiers in format!
This commit is contained in:
@@ -258,9 +258,8 @@ impl Engine {
|
||||
return Err(LexError::ImproperSymbol(
|
||||
s.to_string(),
|
||||
format!(
|
||||
"Improper symbol for custom syntax at position #{}: '{}'",
|
||||
"Improper symbol for custom syntax at position #{}: '{s}'",
|
||||
segments.len() + 1,
|
||||
s
|
||||
),
|
||||
)
|
||||
.into_err(Position::NONE));
|
||||
@@ -282,9 +281,8 @@ impl Engine {
|
||||
return Err(LexError::ImproperSymbol(
|
||||
s.to_string(),
|
||||
format!(
|
||||
"Improper symbol for custom syntax at position #{}: '{}'",
|
||||
"Improper symbol for custom syntax at position #{}: '{s}'",
|
||||
segments.len() + 1,
|
||||
s
|
||||
),
|
||||
)
|
||||
.into_err(Position::NONE));
|
||||
|
@@ -181,7 +181,7 @@ impl Engine {
|
||||
if self.disabled_symbols.is_empty()
|
||||
|| !self.disabled_symbols.contains(&*token.syntax())
|
||||
{
|
||||
return Err(format!("'{}' is a reserved keyword", keyword));
|
||||
return Err(format!("'{keyword}' is a reserved keyword"));
|
||||
}
|
||||
}
|
||||
// Active standard symbols cannot be made custom
|
||||
@@ -189,7 +189,7 @@ impl Engine {
|
||||
if self.disabled_symbols.is_empty()
|
||||
|| !self.disabled_symbols.contains(&*token.syntax())
|
||||
{
|
||||
return Err(format!("'{}' is a reserved operator", keyword));
|
||||
return Err(format!("'{keyword}' is a reserved operator"));
|
||||
}
|
||||
}
|
||||
// Active standard symbols cannot be made custom
|
||||
@@ -197,7 +197,7 @@ impl Engine {
|
||||
if self.disabled_symbols.is_empty()
|
||||
|| !self.disabled_symbols.contains(&*token.syntax()) =>
|
||||
{
|
||||
return Err(format!("'{}' is a reserved symbol", keyword))
|
||||
return Err(format!("'{keyword}' is a reserved symbol"))
|
||||
}
|
||||
// Disabled symbols are OK
|
||||
Some(_) => (),
|
||||
|
@@ -1037,7 +1037,7 @@ impl Engine {
|
||||
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
for (name, m) in &self.global_sub_modules {
|
||||
signatures.extend(m.gen_fn_signatures().map(|f| format!("{}::{}", name, f)));
|
||||
signatures.extend(m.gen_fn_signatures().map(|f| format!("{name}::{f}")));
|
||||
}
|
||||
|
||||
signatures.extend(
|
||||
|
@@ -150,7 +150,7 @@ impl Engine {
|
||||
return if x == r {
|
||||
name.into()
|
||||
} else {
|
||||
format!("&mut {}", r).into()
|
||||
format!("&mut {r}").into()
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user