Use variable interpolation for println!.

This commit is contained in:
Stephen Chung
2022-10-27 13:38:21 +08:00
parent 6b24cc151e
commit 3c2e031883
24 changed files with 132 additions and 150 deletions

View File

@@ -31,10 +31,10 @@ impl fmt::Debug for CallableFunction {
#[inline(never)]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Pure(..) => write!(f, "NativePureFunction"),
Self::Method(..) => write!(f, "NativeMethod"),
Self::Iterator(..) => write!(f, "NativeIterator"),
Self::Plugin(..) => write!(f, "PluginFunction"),
Self::Pure(..) => f.write_str("NativePureFunction"),
Self::Method(..) => f.write_str("NativeMethod"),
Self::Iterator(..) => f.write_str("NativeIterator"),
Self::Plugin(..) => f.write_str("PluginFunction"),
#[cfg(not(feature = "no_function"))]
Self::Script(fn_def) => fmt::Debug::fmt(fn_def, f),
@@ -45,10 +45,10 @@ impl fmt::Debug for CallableFunction {
impl fmt::Display for CallableFunction {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Pure(..) => write!(f, "NativePureFunction"),
Self::Method(..) => write!(f, "NativeMethod"),
Self::Iterator(..) => write!(f, "NativeIterator"),
Self::Plugin(..) => write!(f, "PluginFunction"),
Self::Pure(..) => f.write_str("NativePureFunction"),
Self::Method(..) => f.write_str("NativeMethod"),
Self::Iterator(..) => f.write_str("NativeIterator"),
Self::Plugin(..) => f.write_str("PluginFunction"),
#[cfg(not(feature = "no_function"))]
Self::Script(s) => fmt::Display::fmt(s, f),