You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the readme, printdoc!($fmt, ...) — equivalent to print!(indoc!($fmt), ...), but this case is clearly different. Is there a way to have indoc! properly handle such cases for backward compatibility?
use indoc::{indoc, printdoc};fnmain(){let s = "world";println!(indoc!("Hello {}"), s);printdoc!("Hello {s}");println!(indoc!("Hello {s}"));// error: there is no argument named `s`// --> src/main.rs:8:21// |// 8 | println!(indoc!("Hello {s}"));// | ^^^^^^^^^^^// |// = note: did you intend to capture a variable `s` from the surrounding scope?// = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro}
The text was updated successfully, but these errors were encountered:
According to the readme,
printdoc!($fmt, ...) — equivalent to print!(indoc!($fmt), ...)
, but this case is clearly different. Is there a way to haveindoc!
properly handle such cases for backward compatibility?The text was updated successfully, but these errors were encountered: