File: edit-example.rs

package info (click to toggle)
rust-edit 0.1.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 132 kB
  • sloc: makefile: 4
file content (11 lines) | stat: -rw-r--r-- 328 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
fn main() {
    let string = format!(
        "Hello world!\nYou are editing this file in '{}'.",
        edit::get_editor()
            .expect("can't find an editor")
            .to_str()
            .unwrap()
    );
    let edited = edit::edit(string).expect("editing failed");
    println!("after editing:\n{}", edited);
}