Merge pull request #398 from dtolnay/ra_hir_def

Resolve possible inference disruption by removing unneeded From impl
This commit is contained in:
Ashley Mannix 2020-06-04 14:05:51 +10:00 committed by GitHub
commit c5c8e48f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 9 deletions

View File

@ -41,12 +41,6 @@ impl From<fmt::Error> for Error {
}
}
impl From<Error> for fmt::Error {
fn from(_: Error) -> Self {
fmt::Error
}
}
#[cfg(feature = "std")]
mod std_support {
use super::*;

View File

@ -65,7 +65,7 @@ pub(in kv::value) use self::fmt::{Arguments, Debug, Display};
impl<'v> fmt::Debug for kv::Value<'v> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.visit(&mut FmtVisitor(f))?;
self.visit(&mut FmtVisitor(f)).map_err(|_| fmt::Error)?;
Ok(())
}
@ -73,7 +73,7 @@ impl<'v> fmt::Debug for kv::Value<'v> {
impl<'v> fmt::Display for kv::Value<'v> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.visit(&mut FmtVisitor(f))?;
self.visit(&mut FmtVisitor(f)).map_err(|_| fmt::Error)?;
Ok(())
}

View File

@ -747,7 +747,7 @@ struct KeyValues<'a>(&'a dyn kv::Source);
impl<'a> fmt::Debug for KeyValues<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut visitor = f.debug_map();
self.0.visit(&mut visitor)?;
self.0.visit(&mut visitor).map_err(|_| fmt::Error)?;
visitor.finish()
}
}