improvement: add parser for format strings (#1021)

This PR implements the parser of format strings described in #624.
This commit is contained in:
Zhenhui Xie
2020-04-07 01:16:18 +08:00
committed by GitHub
parent 3510bfe044
commit 22dc419a3e
12 changed files with 517 additions and 4 deletions
+1 -1
View File
@@ -305,7 +305,7 @@ impl Default for SegmentConfig<'static> {
- 'italic'
- '<color>' (see the parse_color_string doc for valid color strings)
*/
fn parse_style_string(style_string: &str) -> Option<ansi_term::Style> {
pub fn parse_style_string(style_string: &str) -> Option<ansi_term::Style> {
style_string
.split_whitespace()
.fold(Some(ansi_term::Style::new()), |maybe_style, token| {