@@ -117,7 +117,7 @@ impl<'a> OverflowableItem<'a> {
117117
118118 pub ( crate ) fn map < F , T > ( & self , f : F ) -> T
119119 where
120- F : Fn ( & dyn IntoOverflowableItem < ' a > ) -> T ,
120+ F : Fn ( & dyn ToOverflowableItem < ' a > ) -> T ,
121121 {
122122 match self {
123123 OverflowableItem :: Expr ( expr) => f ( * expr) ,
@@ -217,48 +217,48 @@ impl<'a> OverflowableItem<'a> {
217217 }
218218}
219219
220- pub ( crate ) trait IntoOverflowableItem < ' a > : Rewrite + Spanned {
221- fn into_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > ;
220+ pub ( crate ) trait ToOverflowableItem < ' a > : Rewrite + Spanned {
221+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > ;
222222}
223223
224- impl < ' a , T : ' a + IntoOverflowableItem < ' a > > IntoOverflowableItem < ' a > for ptr:: P < T > {
225- fn into_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > {
226- ( * * self ) . into_overflowable_item ( )
224+ impl < ' a , T : ' a + ToOverflowableItem < ' a > > ToOverflowableItem < ' a > for ptr:: P < T > {
225+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > {
226+ ( * * self ) . to_overflowable_item ( )
227227 }
228228}
229229
230- macro_rules! impl_into_overflowable_item_for_ast_node {
230+ macro_rules! impl_to_overflowable_item_for_ast_node {
231231 ( $( $ast_node: ident) ,* ) => {
232232 $(
233- impl <' a> IntoOverflowableItem <' a> for ast:: $ast_node {
234- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
233+ impl <' a> ToOverflowableItem <' a> for ast:: $ast_node {
234+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
235235 OverflowableItem :: $ast_node( self )
236236 }
237237 }
238238 ) *
239239 }
240240}
241241
242- macro_rules! impl_into_overflowable_item_for_rustfmt_types {
242+ macro_rules! impl_to_overflowable_item_for_rustfmt_types {
243243 ( [ $( $ty: ident) ,* ] , [ $( $ty_with_lifetime: ident) ,* ] ) => {
244244 $(
245- impl <' a> IntoOverflowableItem <' a> for $ty {
246- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
245+ impl <' a> ToOverflowableItem <' a> for $ty {
246+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
247247 OverflowableItem :: $ty( self )
248248 }
249249 }
250250 ) *
251251 $(
252- impl <' a> IntoOverflowableItem <' a> for $ty_with_lifetime<' a> {
253- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
252+ impl <' a> ToOverflowableItem <' a> for $ty_with_lifetime<' a> {
253+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
254254 OverflowableItem :: $ty_with_lifetime( self )
255255 }
256256 }
257257 ) *
258258 }
259259}
260260
261- impl_into_overflowable_item_for_ast_node ! (
261+ impl_to_overflowable_item_for_ast_node ! (
262262 Expr ,
263263 GenericParam ,
264264 NestedMetaItem ,
@@ -267,18 +267,18 @@ impl_into_overflowable_item_for_ast_node!(
267267 Pat ,
268268 PreciseCapturingArg
269269) ;
270- impl_into_overflowable_item_for_rustfmt_types ! ( [ MacroArg ] , [ SegmentParam , TuplePatField ] ) ;
270+ impl_to_overflowable_item_for_rustfmt_types ! ( [ MacroArg ] , [ SegmentParam , TuplePatField ] ) ;
271271
272272pub ( crate ) fn into_overflowable_list < ' a , T > (
273273 iter : impl Iterator < Item = & ' a T > ,
274274) -> impl Iterator < Item = OverflowableItem < ' a > >
275275where
276- T : ' a + IntoOverflowableItem < ' a > ,
276+ T : ' a + ToOverflowableItem < ' a > ,
277277{
278- iter. map ( |x| IntoOverflowableItem :: into_overflowable_item ( x) )
278+ iter. map ( |x| ToOverflowableItem :: to_overflowable_item ( x) )
279279}
280280
281- pub ( crate ) fn rewrite_with_parens < ' a , T : ' a + IntoOverflowableItem < ' a > > (
281+ pub ( crate ) fn rewrite_with_parens < ' a , T : ' a + ToOverflowableItem < ' a > > (
282282 context : & ' a RewriteContext < ' _ > ,
283283 ident : & ' a str ,
284284 items : impl Iterator < Item = & ' a T > ,
@@ -302,7 +302,7 @@ pub(crate) fn rewrite_with_parens<'a, T: 'a + IntoOverflowableItem<'a>>(
302302 . rewrite ( shape)
303303}
304304
305- pub ( crate ) fn rewrite_with_angle_brackets < ' a , T : ' a + IntoOverflowableItem < ' a > > (
305+ pub ( crate ) fn rewrite_with_angle_brackets < ' a , T : ' a + ToOverflowableItem < ' a > > (
306306 context : & ' a RewriteContext < ' _ > ,
307307 ident : & ' a str ,
308308 items : impl Iterator < Item = & ' a T > ,
@@ -324,7 +324,7 @@ pub(crate) fn rewrite_with_angle_brackets<'a, T: 'a + IntoOverflowableItem<'a>>(
324324 . rewrite ( shape)
325325}
326326
327- pub ( crate ) fn rewrite_with_square_brackets < ' a , T : ' a + IntoOverflowableItem < ' a > > (
327+ pub ( crate ) fn rewrite_with_square_brackets < ' a , T : ' a + ToOverflowableItem < ' a > > (
328328 context : & ' a RewriteContext < ' _ > ,
329329 name : & ' a str ,
330330 items : impl Iterator < Item = & ' a T > ,
@@ -369,7 +369,7 @@ struct Context<'a> {
369369}
370370
371371impl < ' a > Context < ' a > {
372- fn new < T : ' a + IntoOverflowableItem < ' a > > (
372+ fn new < T : ' a + ToOverflowableItem < ' a > > (
373373 context : & ' a RewriteContext < ' _ > ,
374374 items : impl Iterator < Item = & ' a T > ,
375375 ident : & ' a str ,
0 commit comments