Ignore #[cfg_attr(rustfmt, rustfmt_skip)] functions

This adds to #[rustfmt_skip] but is usable on stable Rust!
This commit is contained in:
Alex Crichton 2015-10-22 15:02:53 -07:00
parent 26958a1c10
commit e6b7ad3e39

View file

@ -75,6 +75,9 @@ pub fn last_line_width(s: &str) -> usize {
fn is_skip(meta_item: &MetaItem) -> bool {
match meta_item.node {
MetaItem_::MetaWord(ref s) => *s == SKIP_ANNOTATION,
MetaItem_::MetaList(ref s, ref l) => {
*s == "cfg_attr" && l.len() == 2 && is_skip(&l[1])
}
_ => false,
}
}