Open DerpyCrabs opened 5 years ago
Unfortunately, it is currently not possible:
if let Some(Stmt::Expr(Expr::Lit(ExprLit {
lit: Lit::Str(ref program),
..
}))) = input.block.stmts.iter().next()
include_str!
is a very good extension.
I'm trying to include file using include_str! macro:
#[shell(cmd = "python -c")] fn run_python(name: &str) -> Result<String, Box<std::error::Error>> { include_str("main.py") }
but getting an error on compilation:--> src/main.rs:3:1 | 3 | #[shell(cmd = "python -c")] help: message: Invalid input. Expected fn containing only string literal without any other statements
Is it possible to use include_str! macro for this or can I include file through other means?