Merge pull request #529 from marcusklaas/pattern-indent

Fix indentation for enum-style patterns
This commit is contained in:
Nick Cameron 2015-10-24 11:15:01 +13:00
commit 0c1360a77c
3 changed files with 23 additions and 2 deletions

View File

@ -63,8 +63,9 @@ impl Rewrite for Pat {
if pat_vec.is_empty() {
Some(path_str)
} else {
let width = try_opt!(width.checked_sub(path_str.len()));
let offset = offset + path_str.len();
// 1 = (
let width = try_opt!(width.checked_sub(path_str.len() + 1));
let offset = offset + path_str.len() + 1;
let items = itemize_list(context.codemap,
pat_vec.iter(),
")",

View File

@ -12,3 +12,14 @@ fn main() {
if let None = opt2 { panic!("oh noes"); }
}
impl<'a,'b> ResolveGeneratedContentFragmentMutator<'a,'b> {
fn mutate_fragment(&mut self, fragment: &mut Fragment) {
match **info {
GeneratedContentInfo::ContentItem(
ContentItem::Counter(
ref counter_name,
counter_style
)
) => {}}}
}

View File

@ -14,3 +14,12 @@ fn main() {
panic!("oh noes");
}
}
impl<'a,'b> ResolveGeneratedContentFragmentMutator<'a,'b> {
fn mutate_fragment(&mut self, fragment: &mut Fragment) {
match **info {
GeneratedContentInfo::ContentItem(ContentItem::Counter(ref counter_name,
counter_style)) => {}
}
}
}