Suggest alternatives to Error::description()
This commit is contained in:
parent
a5655b81a3
commit
f6a833a99a
1 changed files with 3 additions and 1 deletions
|
@ -58,6 +58,8 @@ pub trait Error: Debug + Display {
|
||||||
/// new code should use [`Display`] instead
|
/// new code should use [`Display`] instead
|
||||||
/// and new `impl`s can omit it.
|
/// and new `impl`s can omit it.
|
||||||
///
|
///
|
||||||
|
/// To obtain error description as a string, use `to_string()`.
|
||||||
|
///
|
||||||
/// [`Display`]: ../fmt/trait.Display.html
|
/// [`Display`]: ../fmt/trait.Display.html
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
|
@ -73,7 +75,7 @@ pub trait Error: Debug + Display {
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
""
|
"description() is deprecated; use Display"
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The lower-level cause of this error, if any.
|
/// The lower-level cause of this error, if any.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue