self, Attribute, CrateSugar, MetaItem, MetaItemKind, NestedMetaItem, NestedMetaItemKind, Path,
Visibility, VisibilityKind,
};
-use syntax::codemap::{BytePos, Span, NO_EXPANSION};
use syntax::ptr;
+use syntax::source_map::{BytePos, Span, NO_EXPANSION};
+use comment::filter_normal_code;
use rewrite::RewriteContext;
use shape::Shape;
}
#[inline]
-pub fn format_asyncness(asyncness: ast::IsAsync) -> &'static str {
- match asyncness {
+pub fn format_async(is_async: ast::IsAsync) -> &'static str {
+ match is_async {
ast::IsAsync::Async { .. } => "async ",
ast::IsAsync::NotAsync => "",
}
!$self.config.file_lines().is_all() && !$self
.config
.file_lines()
- .intersects(&$self.codemap.lookup_line_range($span))
+ .intersects(&$self.source_map.lookup_line_range($span))
};
}
// Wraps String in an Option. Returns Some when the string adheres to the
// Rewrite constraints defined for the Rewrite trait and None otherwise.
pub fn wrap_str(s: String, max_width: usize, shape: Shape) -> Option<String> {
- if is_valid_str(&s, max_width, shape) {
+ if is_valid_str(&filter_normal_code(&s), max_width, shape) {
Some(s)
} else {
None