aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2016-08-06 05:58:07 -0400
committerTeddy Wing2016-08-06 05:58:07 -0400
commit97feec40b57031156196af7c61ccbc2aba6ec8d7 (patch)
tree97e8b6d84a59a83bb10d6318effd848d404b5ba4
parent833339151a14866ccf499dd57f1849766c7c3555 (diff)
downloadPassextract-97feec40b57031156196af7c61ccbc2aba6ec8d7.tar.bz2
Add documentation for `strip_key`v0.0.1
-rw-r--r--src/main.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 04f2738..4a18223 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -15,6 +15,14 @@ struct Point {
y: usize,
}
+/// Strips the part of a line before and including the first colon.
+///
+/// # Examples
+///
+/// ```
+/// let value = strip_key("e: email@example.com");
+/// assert_eq!(value, "email@example.com");
+/// ```
fn strip_key(line: &str) -> &str {
let strings: Vec<&str> = line.split(": ").collect();
strings[1]