@@ -73,14 +73,7 @@ pub fn debug_struct_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str)
73
73
impl < ' a , ' b : ' a > DebugStruct < ' a , ' b > {
74
74
/// Adds a new field to the generated struct output.
75
75
#[ unstable( feature = "core" , reason = "method was just created" ) ]
76
- #[ inline]
77
76
pub fn field ( mut self , name : & str , value : & fmt:: Debug ) -> DebugStruct < ' a , ' b > {
78
- self . field_inner ( name, value) ;
79
- self
80
- }
81
-
82
- #[ inline( never) ]
83
- fn field_inner ( & mut self , name : & str , value : & fmt:: Debug ) {
84
77
self . result = self . result . and_then ( |_| {
85
78
let prefix = if self . has_fields {
86
79
","
@@ -97,19 +90,13 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
97
90
} ) ;
98
91
99
92
self . has_fields = true ;
93
+ self
100
94
}
101
95
102
96
/// Consumes the `DebugStruct`, finishing output and returning any error
103
97
/// encountered.
104
98
#[ unstable( feature = "core" , reason = "method was just created" ) ]
105
- #[ inline]
106
99
pub fn finish ( mut self ) -> fmt:: Result {
107
- self . finish_inner ( ) ;
108
- self . result
109
- }
110
-
111
- #[ inline( never) ]
112
- fn finish_inner ( & mut self ) {
113
100
if self . has_fields {
114
101
self . result = self . result . and_then ( |_| {
115
102
if self . is_pretty ( ) {
@@ -119,6 +106,7 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
119
106
}
120
107
} ) ;
121
108
}
109
+ self . result
122
110
}
123
111
124
112
fn is_pretty ( & self ) -> bool {
@@ -148,14 +136,7 @@ pub fn debug_tuple_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str) -> D
148
136
impl < ' a , ' b : ' a > DebugTuple < ' a , ' b > {
149
137
/// Adds a new field to the generated tuple struct output.
150
138
#[ unstable( feature = "core" , reason = "method was just created" ) ]
151
- #[ inline]
152
139
pub fn field ( mut self , value : & fmt:: Debug ) -> DebugTuple < ' a , ' b > {
153
- self . field_inner ( value) ;
154
- self
155
- }
156
-
157
- #[ inline( never) ]
158
- fn field_inner ( & mut self , value : & fmt:: Debug ) {
159
140
self . result = self . result . and_then ( |_| {
160
141
let ( prefix, space) = if self . has_fields {
161
142
( "," , " " )
@@ -172,19 +153,13 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
172
153
} ) ;
173
154
174
155
self . has_fields = true ;
156
+ self
175
157
}
176
158
177
159
/// Consumes the `DebugTuple`, finishing output and returning any error
178
160
/// encountered.
179
161
#[ unstable( feature = "core" , reason = "method was just created" ) ]
180
- #[ inline]
181
162
pub fn finish ( mut self ) -> fmt:: Result {
182
- self . finish_inner ( ) ;
183
- self . result
184
- }
185
-
186
- #[ inline( never) ]
187
- fn finish_inner ( & mut self ) {
188
163
if self . has_fields {
189
164
self . result = self . result . and_then ( |_| {
190
165
if self . is_pretty ( ) {
@@ -194,6 +169,7 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
194
169
}
195
170
} ) ;
196
171
}
172
+ self . result
197
173
}
198
174
199
175
fn is_pretty ( & self ) -> bool {
@@ -223,14 +199,7 @@ pub fn debug_set_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str) -> Deb
223
199
impl < ' a , ' b : ' a > DebugSet < ' a , ' b > {
224
200
/// Adds a new entry to the set output.
225
201
#[ unstable( feature = "core" , reason = "method was just created" ) ]
226
- #[ inline]
227
202
pub fn entry ( mut self , entry : & fmt:: Debug ) -> DebugSet < ' a , ' b > {
228
- self . entry_inner ( entry) ;
229
- self
230
- }
231
-
232
- #[ inline( never) ]
233
- fn entry_inner ( & mut self , entry : & fmt:: Debug ) {
234
203
self . result = self . result . and_then ( |_| {
235
204
let prefix = if self . has_fields {
236
205
","
@@ -247,27 +216,21 @@ impl<'a, 'b: 'a> DebugSet<'a, 'b> {
247
216
} ) ;
248
217
249
218
self . has_fields = true ;
219
+ self
250
220
}
251
221
252
222
/// Consumes the `DebugSet`, finishing output and returning any error
253
223
/// encountered.
254
224
#[ unstable( feature = "core" , reason = "method was just created" ) ]
255
- #[ inline]
256
225
pub fn finish ( mut self ) -> fmt:: Result {
257
- self . finish_inner ( ) ;
258
- self . result
259
- }
260
-
261
- #[ inline( never) ]
262
- fn finish_inner ( & mut self ) {
263
- self . result = self . result . and_then ( |_| {
226
+ self . result . and_then ( |_| {
264
227
let end = match ( self . has_fields , self . is_pretty ( ) ) {
265
228
( false , _) => "}" ,
266
229
( true , false ) => " }" ,
267
230
( true , true ) => "\n }" ,
268
231
} ;
269
232
self . fmt . write_str ( end)
270
- } ) ;
233
+ } )
271
234
}
272
235
273
236
fn is_pretty ( & self ) -> bool {
@@ -297,14 +260,7 @@ pub fn debug_map_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str) -> Deb
297
260
impl < ' a , ' b : ' a > DebugMap < ' a , ' b > {
298
261
/// Adds a new entry to the map output.
299
262
#[ unstable( feature = "core" , reason = "method was just created" ) ]
300
- #[ inline]
301
263
pub fn entry ( mut self , key : & fmt:: Debug , value : & fmt:: Debug ) -> DebugMap < ' a , ' b > {
302
- self . entry_inner ( key, value) ;
303
- self
304
- }
305
-
306
- #[ inline( never) ]
307
- fn entry_inner ( & mut self , key : & fmt:: Debug , value : & fmt:: Debug ) {
308
264
self . result = self . result . and_then ( |_| {
309
265
let prefix = if self . has_fields {
310
266
","
@@ -321,27 +277,22 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
321
277
} ) ;
322
278
323
279
self . has_fields = true ;
280
+
281
+ self
324
282
}
325
283
326
284
/// Consumes the `DebugMap`, finishing output and returning any error
327
285
/// encountered.
328
286
#[ unstable( feature = "core" , reason = "method was just created" ) ]
329
- #[ inline]
330
287
pub fn finish ( mut self ) -> fmt:: Result {
331
- self . finish_inner ( ) ;
332
- self . result
333
- }
334
-
335
- #[ inline( never) ]
336
- fn finish_inner ( & mut self ) {
337
- self . result = self . result . and_then ( |_| {
288
+ self . result . and_then ( |_| {
338
289
let end = match ( self . has_fields , self . is_pretty ( ) ) {
339
290
( false , _) => "}" ,
340
291
( true , false ) => " }" ,
341
292
( true , true ) => "\n }" ,
342
293
} ;
343
294
self . fmt . write_str ( end)
344
- } ) ;
295
+ } )
345
296
}
346
297
347
298
fn is_pretty ( & self ) -> bool {
0 commit comments