Remove String::rewrite()

This commit is contained in:
Seiichi Uchida 2017-10-07 21:58:29 +09:00
parent 2b6e50436c
commit dde0cdabe0

View file

@ -15,7 +15,7 @@ use syntax::ast::{self, Attribute, MetaItem, MetaItemKind, NestedMetaItem, Neste
Path, Visibility};
use syntax::codemap::{BytePos, Span, NO_EXPANSION};
use rewrite::{Rewrite, RewriteContext};
use rewrite::RewriteContext;
use shape::Shape;
// When we get scoped annotations, we should have rustfmt::skip.
@ -425,12 +425,6 @@ pub fn wrap_str<S: AsRef<str>>(s: S, max_width: usize, shape: Shape) -> Option<S
Some(s)
}
impl Rewrite for String {
fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
wrap_str(self, context.config.max_width(), shape).map(ToOwned::to_owned)
}
}
#[inline]
pub fn colon_spaces(before: bool, after: bool) -> &'static str {
match (before, after) {