@@ -104,7 +104,7 @@ impl<'a> OverflowableItem<'a> {
104104
105105 pub ( crate ) fn map < F , T > ( & self , f : F ) -> T
106106 where
107- F : Fn ( & dyn IntoOverflowableItem < ' a > ) -> T ,
107+ F : Fn ( & dyn ToOverflowableItem < ' a > ) -> T ,
108108 {
109109 match self {
110110 OverflowableItem :: Expr ( expr) => f ( * expr) ,
@@ -191,60 +191,60 @@ impl<'a> OverflowableItem<'a> {
191191 }
192192}
193193
194- pub ( crate ) trait IntoOverflowableItem < ' a > : Rewrite + Spanned {
195- fn into_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > ;
194+ pub ( crate ) trait ToOverflowableItem < ' a > : Rewrite + Spanned {
195+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > ;
196196}
197197
198- impl < ' a , T : ' a + IntoOverflowableItem < ' a > > IntoOverflowableItem < ' a > for ptr:: P < T > {
199- fn into_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > {
200- ( * * self ) . into_overflowable_item ( )
198+ impl < ' a , T : ' a + ToOverflowableItem < ' a > > ToOverflowableItem < ' a > for ptr:: P < T > {
199+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem < ' a > {
200+ ( * * self ) . to_overflowable_item ( )
201201 }
202202}
203203
204- macro_rules! impl_into_overflowable_item_for_ast_node {
204+ macro_rules! impl_to_overflowable_item_for_ast_node {
205205 ( $( $ast_node: ident) ,* ) => {
206206 $(
207- impl <' a> IntoOverflowableItem <' a> for ast:: $ast_node {
208- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
207+ impl <' a> ToOverflowableItem <' a> for ast:: $ast_node {
208+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
209209 OverflowableItem :: $ast_node( self )
210210 }
211211 }
212212 ) *
213213 }
214214}
215215
216- macro_rules! impl_into_overflowable_item_for_rustfmt_types {
216+ macro_rules! impl_to_overflowable_item_for_rustfmt_types {
217217 ( [ $( $ty: ident) ,* ] , [ $( $ty_with_lifetime: ident) ,* ] ) => {
218218 $(
219- impl <' a> IntoOverflowableItem <' a> for $ty {
220- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
219+ impl <' a> ToOverflowableItem <' a> for $ty {
220+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
221221 OverflowableItem :: $ty( self )
222222 }
223223 }
224224 ) *
225225 $(
226- impl <' a> IntoOverflowableItem <' a> for $ty_with_lifetime<' a> {
227- fn into_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
226+ impl <' a> ToOverflowableItem <' a> for $ty_with_lifetime<' a> {
227+ fn to_overflowable_item ( & ' a self ) -> OverflowableItem <' a> {
228228 OverflowableItem :: $ty_with_lifetime( self )
229229 }
230230 }
231231 ) *
232232 }
233233}
234234
235- impl_into_overflowable_item_for_ast_node ! ( Expr , GenericParam , NestedMetaItem , FieldDef , Ty , Pat ) ;
236- impl_into_overflowable_item_for_rustfmt_types ! ( [ MacroArg ] , [ SegmentParam , TuplePatField ] ) ;
235+ impl_to_overflowable_item_for_ast_node ! ( Expr , GenericParam , NestedMetaItem , FieldDef , Ty , Pat ) ;
236+ impl_to_overflowable_item_for_rustfmt_types ! ( [ MacroArg ] , [ SegmentParam , TuplePatField ] ) ;
237237
238238pub ( crate ) fn into_overflowable_list < ' a , T > (
239239 iter : impl Iterator < Item = & ' a T > ,
240240) -> impl Iterator < Item = OverflowableItem < ' a > >
241241where
242- T : ' a + IntoOverflowableItem < ' a > ,
242+ T : ' a + ToOverflowableItem < ' a > ,
243243{
244- iter. map ( |x| IntoOverflowableItem :: into_overflowable_item ( x) )
244+ iter. map ( |x| ToOverflowableItem :: to_overflowable_item ( x) )
245245}
246246
247- pub ( crate ) fn rewrite_with_parens < ' a , T : ' a + IntoOverflowableItem < ' a > > (
247+ pub ( crate ) fn rewrite_with_parens < ' a , T : ' a + ToOverflowableItem < ' a > > (
248248 context : & ' a RewriteContext < ' _ > ,
249249 ident : & ' a str ,
250250 items : impl Iterator < Item = & ' a T > ,
@@ -268,7 +268,7 @@ pub(crate) fn rewrite_with_parens<'a, T: 'a + IntoOverflowableItem<'a>>(
268268 . rewrite ( shape)
269269}
270270
271- pub ( crate ) fn rewrite_with_angle_brackets < ' a , T : ' a + IntoOverflowableItem < ' a > > (
271+ pub ( crate ) fn rewrite_with_angle_brackets < ' a , T : ' a + ToOverflowableItem < ' a > > (
272272 context : & ' a RewriteContext < ' _ > ,
273273 ident : & ' a str ,
274274 items : impl Iterator < Item = & ' a T > ,
@@ -290,7 +290,7 @@ pub(crate) fn rewrite_with_angle_brackets<'a, T: 'a + IntoOverflowableItem<'a>>(
290290 . rewrite ( shape)
291291}
292292
293- pub ( crate ) fn rewrite_with_square_brackets < ' a , T : ' a + IntoOverflowableItem < ' a > > (
293+ pub ( crate ) fn rewrite_with_square_brackets < ' a , T : ' a + ToOverflowableItem < ' a > > (
294294 context : & ' a RewriteContext < ' _ > ,
295295 name : & ' a str ,
296296 items : impl Iterator < Item = & ' a T > ,
@@ -335,7 +335,7 @@ struct Context<'a> {
335335}
336336
337337impl < ' a > Context < ' a > {
338- fn new < T : ' a + IntoOverflowableItem < ' a > > (
338+ fn new < T : ' a + ToOverflowableItem < ' a > > (
339339 context : & ' a RewriteContext < ' _ > ,
340340 items : impl Iterator < Item = & ' a T > ,
341341 ident : & ' a str ,
0 commit comments