You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation example contains the deprecated std::error::Error::description method in the main function:
fnmain(){matchget_super_error(){Err(e) => {println!("Error: {}", e.description());// <----------- HERE IT ISprintln!("Caused by: {}", e.source().unwrap());}
_ => println!("No error"),}}
This is probably a mistake as get_super_error returns a struct that implements the std::fmt::Display trait which should be used instead of the deprecated std::error::Error::description method. So, this:
println!("Error: {}", e.description());
...should be written like this:
println!("Error: {}", e);
The text was updated successfully, but these errors were encountered:
https://doc.rust-lang.org/std/error/trait.Error.html#method.source.
The documentation example contains the deprecated
std::error::Error::description
method in themain
function:This is probably a mistake as
get_super_error
returns astruct
thatimpl
ements thestd::fmt::Display
trait which should be used instead of the deprecatedstd::error::Error::description
method. So, this:...should be written like this:
The text was updated successfully, but these errors were encountered: