@@ -116,7 +116,7 @@ impl<'a> OverflowableItem<'a> {
116116
117117 pub ( crate ) fn map < F , T > ( & self , f : F ) -> T
118118 where
119- F : Fn ( & dyn IntoOverflowableItem < ' a > ) -> T ,
119+ F : Fn ( & dyn ToOverflowableItem < ' a > ) -> T ,
120120 {
121121 match self {
122122 OverflowableItem :: Expr ( expr) => f ( * expr) ,
@@ -216,48 +216,48 @@ impl<'a> OverflowableItem<'a> {
216216 }
217217}
218218
219- pub ( crate ) trait IntoOverflowableItem < ' a > : Rewrite + Spanned {
220- fn into_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > ;
219+ pub ( crate ) trait ToOverflowableItem < ' a > : Rewrite + Spanned {
220+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > ;
221221}
222222
223- impl < ' a , T : ' a + IntoOverflowableItem < ' a > > IntoOverflowableItem < ' a > for ptr:: P < T > {
224- fn into_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > {
225- ( * * self ) . into_overflowable_item ( )
223+ impl < ' a , T : ' a + ToOverflowableItem < ' a > > ToOverflowableItem < ' a > for ptr:: P < T > {
224+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > {
225+ ( * * self ) . to_overflowable_item ( )
226226 }
227227}
228228
229- macro_rules! impl_into_overflowable_item_for_ast_node {
229+ macro_rules! impl_to_overflowable_item_for_ast_node {
230230 ( $( $ast_node: ident) ,* ) => {
231231 $(
232- impl <' a> IntoOverflowableItem <' a> for ast:: $ast_node {
233- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
232+ impl <' a> ToOverflowableItem <' a> for ast:: $ast_node {
233+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
234234 OverflowableItem :: $ast_node( self )
235235 }
236236 }
237237 ) *
238238 }
239239}
240240
241- macro_rules! impl_into_overflowable_item_for_rustfmt_types {
241+ macro_rules! impl_to_overflowable_item_for_rustfmt_types {
242242 ( [ $( $ty: ident) ,* ] , [ $( $ty_with_lifetime: ident) ,* ] ) => {
243243 $(
244- impl <' a> IntoOverflowableItem <' a> for $ty {
245- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
244+ impl <' a> ToOverflowableItem <' a> for $ty {
245+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
246246 OverflowableItem :: $ty( self )
247247 }
248248 }
249249 ) *
250250 $(
251- impl <' a> IntoOverflowableItem <' a> for $ty_with_lifetime<' a> {
252- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
251+ impl <' a> ToOverflowableItem <' a> for $ty_with_lifetime<' a> {
252+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
253253 OverflowableItem :: $ty_with_lifetime( self )
254254 }
255255 }
256256 ) *
257257 }
258258}
259259
260- impl_into_overflowable_item_for_ast_node ! (
260+ impl_to_overflowable_item_for_ast_node ! (
261261 Expr ,
262262 GenericParam ,
263263 NestedMetaItem ,
@@ -266,18 +266,18 @@ impl_into_overflowable_item_for_ast_node!(
266266 Pat ,
267267 PreciseCapturingArg
268268) ;
269- impl_into_overflowable_item_for_rustfmt_types ! ( [ MacroArg ] , [ SegmentParam , TuplePatField ] ) ;
269+ impl_to_overflowable_item_for_rustfmt_types ! ( [ MacroArg ] , [ SegmentParam , TuplePatField ] ) ;
270270
271271pub ( crate ) fn into_overflowable_list < ' a , T > (
272272 iter : impl Iterator < Item = & ' a T > ,
273273) -> impl Iterator < Item = OverflowableItem < ' a > >
274274where
275- T : ' a + IntoOverflowableItem < ' a > ,
275+ T : ' a + ToOverflowableItem < ' a > ,
276276{
277- iter. map ( |x| IntoOverflowableItem :: into_overflowable_item ( x) )
277+ iter. map ( |x| ToOverflowableItem :: to_overflowable_item ( x) )
278278}
279279
280- pub ( crate ) fn rewrite_with_parens < ' a , T : ' a + IntoOverflowableItem < ' a > > (
280+ pub ( crate ) fn rewrite_with_parens < ' a , T : ' a + ToOverflowableItem < ' a > > (
281281 context : & ' a RewriteContext < ' _ > ,
282282 ident : & ' a str ,
283283 items : impl Iterator < Item = & ' a T > ,
@@ -301,7 +301,7 @@ pub(crate) fn rewrite_with_parens<'a, T: 'a + IntoOverflowableItem<'a>>(
301301 . rewrite ( shape)
302302}
303303
304- pub ( crate ) fn rewrite_with_angle_brackets < ' a , T : ' a + IntoOverflowableItem < ' a > > (
304+ pub ( crate ) fn rewrite_with_angle_brackets < ' a , T : ' a + ToOverflowableItem < ' a > > (
305305 context : & ' a RewriteContext < ' _ > ,
306306 ident : & ' a str ,
307307 items : impl Iterator < Item = & ' a T > ,
@@ -323,7 +323,7 @@ pub(crate) fn rewrite_with_angle_brackets<'a, T: 'a + IntoOverflowableItem<'a>>(
323323 . rewrite ( shape)
324324}
325325
326- pub ( crate ) fn rewrite_with_square_brackets < ' a , T : ' a + IntoOverflowableItem < ' a > > (
326+ pub ( crate ) fn rewrite_with_square_brackets < ' a , T : ' a + ToOverflowableItem < ' a > > (
327327 context : & ' a RewriteContext < ' _ > ,
328328 name : & ' a str ,
329329 items : impl Iterator < Item = & ' a T > ,
@@ -368,7 +368,7 @@ struct Context<'a> {
368368}
369369
370370impl < ' a > Context < ' a > {
371- fn new < T : ' a + IntoOverflowableItem < ' a > > (
371+ fn new < T : ' a + ToOverflowableItem < ' a > > (
372372 context : & ' a RewriteContext < ' _ > ,
373373 items : impl Iterator < Item = & ' a T > ,
374374 ident : & ' a str ,
0 commit comments