| 1 |
fn main() { |
| 2 |
let string = format!( |
| 3 |
"Hello world!\nYou are editing this file in '{}'.", |
| 4 |
edit::get_editor() |
| 5 |
.expect("can't find an editor") |
| 6 |
.to_str() |
| 7 |
.unwrap() |
| 8 |
); |
| 9 |
let edited = edit::edit(string).expect("editing failed"); |
| 10 |
println!("after editing:\n{}", edited); |
| 11 |
} |