From 97feec40b57031156196af7c61ccbc2aba6ec8d7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 6 Aug 2016 05:58:07 -0400 Subject: Add documentation for `strip_key` --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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] -- cgit v1.2.3