cli dollcode encoder and decoder

improve docs

0xda157 8224ae17 e9a31013

+7 -4
+7 -4
lib-porcelain/src/lib.rs
··· 1 - /// Decodes a string slice containing a dollcode into a u64. Returns None if 2 - /// input contains invalid characters (everything expect '▖', '▘', and '▌'). 1 + /// Decodes a `&str` containing a dollcode into a `u64`. 2 + /// Returns `None` if `input` contains invalid characters 3 + /// (everything except `'▖'`, `'▘'`, and `'▌'`). 3 4 /// 4 5 /// # Example 5 6 /// 6 7 /// ``` 7 8 /// use lib_porcelain::dollcode_decode; 9 + /// 10 + /// assert_eq!(dollcode_decode(""), Some(0)); 8 11 /// 9 12 /// assert_eq!(dollcode_decode("▖▖▘▘▌▘▌▌▘▘▘▌▌"), Some(893271)); 10 13 /// ··· 26 29 Some(acc) 27 30 } 28 31 29 - /// Takes a u64 and encodes in to a String containing a dollcode made up of 30 - /// '▖', '▘', and '▌'. 32 + /// Takes a `u64` and encodes in to a `String` containing a dollcode made up of 33 + /// `'▖'`, `'▘'`, and `'▌'`. 31 34 /// 32 35 /// # Example 33 36 ///