1
1
use std:: fmt:: { self , Write } ;
2
2
3
- use bound:: Bound ;
4
-
5
- use r#type:: Type ;
3
+ use crate :: bound:: Bound ;
6
4
5
+ use crate :: r#type:: Type ;
7
6
8
7
const DEFAULT_INDENT : usize = 4 ;
9
8
10
-
11
9
/// Configures how a scope is formatted.
12
10
#[ derive( Debug ) ]
13
11
pub struct Formatter < ' a > {
@@ -21,7 +19,6 @@ pub struct Formatter<'a> {
21
19
indent : usize ,
22
20
}
23
21
24
-
25
22
impl < ' a > Formatter < ' a > {
26
23
/// Return a new formatter that writes to the given string.
27
24
pub fn new ( dst : & ' a mut String ) -> Self {
@@ -102,9 +99,8 @@ impl<'a> fmt::Write for Formatter<'a> {
102
99
}
103
100
}
104
101
105
-
106
102
/// Format generics.
107
- pub fn fmt_generics ( generics : & [ String ] , fmt : & mut Formatter ) -> fmt:: Result {
103
+ pub fn fmt_generics ( generics : & [ String ] , fmt : & mut Formatter < ' _ > ) -> fmt:: Result {
108
104
if !generics. is_empty ( ) {
109
105
write ! ( fmt, "<" ) ?;
110
106
@@ -122,7 +118,7 @@ pub fn fmt_generics(generics: &[String], fmt: &mut Formatter) -> fmt::Result {
122
118
}
123
119
124
120
/// Format generic bounds.
125
- pub fn fmt_bounds ( bounds : & [ Bound ] , fmt : & mut Formatter ) -> fmt:: Result {
121
+ pub fn fmt_bounds ( bounds : & [ Bound ] , fmt : & mut Formatter < ' _ > ) -> fmt:: Result {
126
122
if !bounds. is_empty ( ) {
127
123
write ! ( fmt, "\n " ) ?;
128
124
@@ -142,7 +138,7 @@ pub fn fmt_bounds(bounds: &[Bound], fmt: &mut Formatter) -> fmt::Result {
142
138
}
143
139
144
140
/// Format multiple generic bounds.
145
- pub fn fmt_bound_rhs ( tys : & [ Type ] , fmt : & mut Formatter ) -> fmt:: Result {
141
+ pub fn fmt_bound_rhs ( tys : & [ Type ] , fmt : & mut Formatter < ' _ > ) -> fmt:: Result {
146
142
for ( i, ty) in tys. iter ( ) . enumerate ( ) {
147
143
if i != 0 {
148
144
write ! ( fmt, " + " ) ?
0 commit comments