|
363 | 363 | //! # use std::fmt;
|
364 | 364 | //! # struct Foo; // our custom type
|
365 | 365 | //! # impl fmt::Display for Foo {
|
366 |
| -//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 366 | +//! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
367 | 367 | //! # write!(f, "testing, testing")
|
368 | 368 | //! # } }
|
369 | 369 | //! ```
|
|
399 | 399 | //! }
|
400 | 400 | //!
|
401 | 401 | //! impl fmt::Display for Vector2D {
|
402 |
| -//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 402 | +//! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
403 | 403 | //! // The `f` value implements the `Write` trait, which is what the
|
404 | 404 | //! // write! macro is expecting. Note that this formatting ignores the
|
405 | 405 | //! // various flags provided to format strings.
|
|
410 | 410 | //! // Different traits allow different forms of output of a type. The meaning
|
411 | 411 | //! // of this format is to print the magnitude of a vector.
|
412 | 412 | //! impl fmt::Binary for Vector2D {
|
413 |
| -//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 413 | +//! fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
414 | 414 | //! let magnitude = (self.x * self.x + self.y * self.y) as f64;
|
415 | 415 | //! let magnitude = magnitude.sqrt();
|
416 | 416 | //!
|
|
517 | 517 | //! let mut some_writer = io::stdout();
|
518 | 518 | //! write!(&mut some_writer, "{}", format_args!("print with a {}", "macro"));
|
519 | 519 | //!
|
520 |
| -//! fn my_fmt_fn(args: fmt::Arguments) { |
| 520 | +//! fn my_fmt_fn(args: fmt::Arguments<'_>) { |
521 | 521 | //! write!(&mut io::stdout(), "{args}");
|
522 | 522 | //! }
|
523 | 523 | //! my_fmt_fn(format_args!(", or a {} too", "function"));
|
|
0 commit comments