Add the local crate failed. #111
Unanswered
baiguoname
asked this question in
Q&A
Replies: 2 comments
-
add_dep needs to be used exactly like use cargo add cli, so for example use irust_repl::Repl;
fn main() {
let mut repl = Repl::default();
repl.add_dep(&["--path".into(), "/tmp/lab/hello".into()])
.unwrap()
.wait()
.unwrap();
dbg!(repl.eval(r#"println!("{}",hello::add(1,2))"#).unwrap());
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using
irust_repl
crate like this:`use irust_repl::{EvalConfig, Repl, DEFAULT_EVALUATOR};
fn main() {
let mut repl = Repl::default();
repl.add_dep(&["chrono".to_string(), "rand".to_string(), "serde".to_string()]).unwrap().wait().unwrap();
repl.insert(
r#"
use chrono::NaiveDateTime;
let dt = NaiveDateTime::default();
println!("{}", dt);
}`
It works fine. But when I add local crate, it fails. What am I doing wrong?
let mut repl = Repl::default(); repl.add_dep(&[r#"name = { path = "local_crate_path" }"#.to_string()]).unwrap().wait().unwrap(); repl.insert( r#" use chrono::NaiveDateTime; let dt = NaiveDateTime::default(); println!("{}", dt);
Beta Was this translation helpful? Give feedback.
All reactions