From bfbc5dc4455e01ed5e6f5fb8dd2dca47497d73a9 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 6 Aug 2016 01:25:40 -0400 Subject: Add a function that strips the "key" part from the line Lines are formatted like: e: email@example.com This function turns that into: email@example.com It will be used to strip the "key" so that we can copy only the "value" part of the line to the system clipboard. --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index fd60bee..19c2ab7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,11 @@ struct Point { y: usize, } +fn strip_key(line: &str) -> &str { + let strings: Vec<&str> = line.split(": ").collect(); + strings[1] +} + fn main() { let mut term = Terminal::new().unwrap(); term.swap_buffers().unwrap(); -- cgit v1.2.3