6161//!
6262//! * Instead of defining the custom `Error` type as an enum, it is a
6363//! struct containing an `ErrorKind` (which defines the
64- //! `description` and `display ` methods for the error), an opaque,
64+ //! `description` and `display_chain ` methods for the error), an opaque,
6565//! optional, boxed `std::error::Error + Send + 'static` object
6666//! (which defines the `cause`, and establishes the links in the
6767//! error chain), and a `Backtrace`.
390390//!
391391//! ```
392392//! # #[macro_use] extern crate error_chain;
393- //! use error_chain::ChainedError; // for e.display ()
393+ //! use error_chain::ChainedError; // for e.display_chain ()
394394//!
395395//! error_chain! {
396396//! errors {
414414//! assert_eq!(e.to_string(), "invalid toolchain name: 'xyzzy'");
415415//!
416416//! // Get the full cause and backtrace:
417- //! println!("{}", e.display ().to_string());
417+ //! println!("{}", e.display_chain ().to_string());
418418//! // Error: invalid toolchain name: 'xyzzy'
419419//! // Caused by: invalid digit found in string
420420//! // stack backtrace:
@@ -550,8 +550,8 @@ pub trait ChainedError: error::Error + Send + 'static {
550550 /// context of this error.
551551 ///
552552 /// The full cause chain and backtrace, if present, will be printed.
553- fn display < ' a > ( & ' a self ) -> Display < ' a , Self > {
554- Display ( self )
553+ fn display_chain < ' a > ( & ' a self ) -> DisplayChain < ' a , Self > {
554+ DisplayChain ( self )
555555 }
556556
557557 /// Extends the error chain with a new entry.
@@ -573,9 +573,9 @@ pub trait ChainedError: error::Error + Send + 'static {
573573
574574/// A struct which formats an error for output.
575575#[ derive( Debug ) ]
576- pub struct Display < ' a , T : ' a + ?Sized > ( & ' a T ) ;
576+ pub struct DisplayChain < ' a , T : ' a + ?Sized > ( & ' a T ) ;
577577
578- impl < ' a , T > fmt:: Display for Display < ' a , T >
578+ impl < ' a , T > fmt:: Display for DisplayChain < ' a , T >
579579 where T : ChainedError
580580{
581581 fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
0 commit comments