@@ -229,14 +229,28 @@ macro_rules! try {
229
229
} )
230
230
}
231
231
232
- /// Use the `format!` syntax to write data into a buffer.
232
+ /// Write formatted data into a buffer
233
233
///
234
- /// This macro is typically used with a buffer of `&mut `[`Write`][write].
234
+ /// This macro accepts any value with `write_fmt` method as a writer, a format string, and a list
235
+ /// of arguments to format.
236
+ ///
237
+ /// `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write] or
238
+ /// [`std::io::Write`][io_write] traits. These are sometimes called 'writers'.
239
+ ///
240
+ /// Passed arguments will be formatted according to the specified format string and the resulting
241
+ /// string will be passed to the writer.
235
242
///
236
243
/// See [`std::fmt`][fmt] for more information on format syntax.
237
244
///
245
+ /// Return value is completely dependent on the 'write_fmt' method.
246
+ ///
247
+ /// Common return values are: [`Result`][enum_result], [`io::Result`][type_result]
248
+ ///
238
249
/// [fmt]: ../std/fmt/index.html
239
- /// [write]: ../std/io/trait.Write.html
250
+ /// [fmt_write]: ../std/fmt/trait.Write.html
251
+ /// [io_write]: ../std/io/trait.Write.html
252
+ /// [enum_result]: ../std/result/enum.Result.html
253
+ /// [type_result]: ../std/io/type.Result.html
240
254
///
241
255
/// # Examples
242
256
///
@@ -255,16 +269,31 @@ macro_rules! write {
255
269
( $dst: expr, $( $arg: tt) * ) => ( $dst. write_fmt( format_args!( $( $arg) * ) ) )
256
270
}
257
271
258
- /// Use the `format!` syntax to write data into a buffer, appending a newline.
259
- /// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`)
260
- /// alone (no additional CARRIAGE RETURN (`\r`/`U+000D`).
272
+ /// Write formatted data into a buffer, with appending a newline.
273
+ ///
274
+ /// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone
275
+ /// (no additional CARRIAGE RETURN (`\r`/`U+000D`).
261
276
///
262
- /// This macro is typically used with a buffer of `&mut `[`Write`][write].
277
+ /// This macro accepts any value with `write_fmt` method as a writer, a format string, and a list
278
+ /// of arguments to format.
279
+ ///
280
+ /// `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write] or
281
+ /// [`std::io::Write`][io_write] traits. These are sometimes called 'writers'.
282
+ ///
283
+ /// Passed arguments will be formatted according to the specified format string and the resulting
284
+ /// string will be passed to the writer.
263
285
///
264
286
/// See [`std::fmt`][fmt] for more information on format syntax.
265
287
///
288
+ /// Return value is completely dependent on the 'write_fmt' method.
289
+ ///
290
+ /// Common return values are: [`Result`][enum_result], [`io::Result`][type_result]
291
+ ///
266
292
/// [fmt]: ../std/fmt/index.html
267
- /// [write]: ../std/io/trait.Write.html
293
+ /// [fmt_write]: ../std/fmt/trait.Write.html
294
+ /// [io_write]: ../std/io/trait.Write.html
295
+ /// [enum_result]: ../std/result/enum.Result.html
296
+ /// [type_result]: ../std/io/type.Result.html
268
297
///
269
298
/// # Examples
270
299
///
0 commit comments