a bit better prompt printing
This commit is contained in:
parent
b638918a89
commit
751388b04c
1 changed files with 6 additions and 1 deletions
|
|
@ -123,7 +123,12 @@ fn main() {
|
|||
eprintln!("{}", err);
|
||||
Box::new(Ctr::String("<prompt broken!>".to_string()))
|
||||
});
|
||||
let p_str = s.to_string();
|
||||
let p_str: String;
|
||||
if let Ctr::String(s) = s {
|
||||
p_str = s;
|
||||
} else {
|
||||
p_str = s.to_string();
|
||||
}
|
||||
let readline_prompt = CustomPrompt(p_str.as_str());
|
||||
|
||||
let user_doc = rl.read_line(&readline_prompt).unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue