Format source codes

This commit is contained in:
topecongiro 2017-05-25 16:08:08 +09:00
parent 2580d7a310
commit 86856491bc
10 changed files with 31 additions and 45 deletions

View file

@ -35,8 +35,7 @@ pub fn rewrite_string<'a>(orig: &str, fmt: &StringFormat<'a>) -> Option<String>
let re = Regex::new(r"([^\\](\\\\)*)\\[\n\r][[:space:]]*").unwrap();
let stripped_str = re.replace_all(orig, "$1");
let graphemes = UnicodeSegmentation::graphemes(&*stripped_str, false)
.collect::<Vec<&str>>();
let graphemes = UnicodeSegmentation::graphemes(&*stripped_str, false).collect::<Vec<&str>>();
let shape = fmt.shape.visual_indent(0);
let indent = shape.indent.to_string(fmt.config);
let punctuation = ":,;.";