@@ -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) ,
@@ -215,48 +215,48 @@ impl<'a> OverflowableItem<'a> {
215215 }
216216}
217217
218- pub ( crate ) trait IntoOverflowableItem < ' a > : Rewrite + Spanned {
219- fn into_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > ;
218+ pub ( crate ) trait ToOverflowableItem < ' a > : Rewrite + Spanned {
219+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > ;
220220}
221221
222- impl < ' a , T : ' a + IntoOverflowableItem < ' a > > IntoOverflowableItem < ' a > for Box < T > {
223- fn into_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > {
224- ( * * self ) . into_overflowable_item ( )
222+ impl < ' a , T : ' a + ToOverflowableItem < ' a > > ToOverflowableItem < ' a > for Box < T > {
223+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > {
224+ ( * * self ) . to_overflowable_item ( )
225225 }
226226}
227227
228- macro_rules! impl_into_overflowable_item_for_ast_node {
228+ macro_rules! impl_to_overflowable_item_for_ast_node {
229229 ( $( $ast_node: ident) ,* ) => {
230230 $(
231- impl <' a> IntoOverflowableItem <' a> for ast:: $ast_node {
232- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
231+ impl <' a> ToOverflowableItem <' a> for ast:: $ast_node {
232+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
233233 OverflowableItem :: $ast_node( self )
234234 }
235235 }
236236 ) *
237237 }
238238}
239239
240- macro_rules! impl_into_overflowable_item_for_rustfmt_types {
240+ macro_rules! impl_to_overflowable_item_for_rustfmt_types {
241241 ( [ $( $ty: ident) ,* ] , [ $( $ty_with_lifetime: ident) ,* ] ) => {
242242 $(
243- impl <' a> IntoOverflowableItem <' a> for $ty {
244- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
243+ impl <' a> ToOverflowableItem <' a> for $ty {
244+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
245245 OverflowableItem :: $ty( self )
246246 }
247247 }
248248 ) *
249249 $(
250- impl <' a> IntoOverflowableItem <' a> for $ty_with_lifetime<' a> {
251- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
250+ impl <' a> ToOverflowableItem <' a> for $ty_with_lifetime<' a> {
251+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
252252 OverflowableItem :: $ty_with_lifetime( self )
253253 }
254254 }
255255 ) *
256256 }
257257}
258258
259- impl_into_overflowable_item_for_ast_node ! (
259+ impl_to_overflowable_item_for_ast_node ! (
260260 Expr ,
261261 GenericParam ,
262262 MetaItemInner ,
@@ -265,18 +265,18 @@ impl_into_overflowable_item_for_ast_node!(
265265 Pat ,
266266 PreciseCapturingArg
267267) ;
268- impl_into_overflowable_item_for_rustfmt_types ! ( [ MacroArg ] , [ SegmentParam , TuplePatField ] ) ;
268+ impl_to_overflowable_item_for_rustfmt_types ! ( [ MacroArg ] , [ SegmentParam , TuplePatField ] ) ;
269269
270270pub ( crate ) fn into_overflowable_list < ' a , T > (
271271 iter : impl Iterator < Item = & ' a T > ,
272272) -> impl Iterator < Item = OverflowableItem < ' a > >
273273where
274- T : ' a + IntoOverflowableItem < ' a > ,
274+ T : ' a + ToOverflowableItem < ' a > ,
275275{
276- iter. map ( |x| IntoOverflowableItem :: into_overflowable_item ( x) )
276+ iter. map ( |x| ToOverflowableItem :: to_overflowable_item ( x) )
277277}
278278
279- pub ( crate ) fn rewrite_with_parens < ' a , T : ' a + IntoOverflowableItem < ' a > > (
279+ pub ( crate ) fn rewrite_with_parens < ' a , T : ' a + ToOverflowableItem < ' a > > (
280280 context : & ' a RewriteContext < ' _ > ,
281281 ident : & ' a str ,
282282 items : impl Iterator < Item = & ' a T > ,
@@ -300,7 +300,7 @@ pub(crate) fn rewrite_with_parens<'a, T: 'a + IntoOverflowableItem<'a>>(
300300 . rewrite ( shape)
301301}
302302
303- pub ( crate ) fn rewrite_with_angle_brackets < ' a , T : ' a + IntoOverflowableItem < ' a > > (
303+ pub ( crate ) fn rewrite_with_angle_brackets < ' a , T : ' a + ToOverflowableItem < ' a > > (
304304 context : & ' a RewriteContext < ' _ > ,
305305 ident : & ' a str ,
306306 items : impl Iterator < Item = & ' a T > ,
@@ -322,7 +322,7 @@ pub(crate) fn rewrite_with_angle_brackets<'a, T: 'a + IntoOverflowableItem<'a>>(
322322 . rewrite ( shape)
323323}
324324
325- pub ( crate ) fn rewrite_with_square_brackets < ' a , T : ' a + IntoOverflowableItem < ' a > > (
325+ pub ( crate ) fn rewrite_with_square_brackets < ' a , T : ' a + ToOverflowableItem < ' a > > (
326326 context : & ' a RewriteContext < ' _ > ,
327327 name : & ' a str ,
328328 items : impl Iterator < Item = & ' a T > ,
@@ -367,7 +367,7 @@ struct Context<'a> {
367367}
368368
369369impl < ' a > Context < ' a > {
370- fn new < T : ' a + IntoOverflowableItem < ' a > > (
370+ fn new < T : ' a + ToOverflowableItem < ' a > > (
371371 context : & ' a RewriteContext < ' _ > ,
372372 items : impl Iterator < Item = & ' a T > ,
373373 ident : & ' a str ,
0 commit comments