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