Add a convert::Infallible empty enum, make string::ParseError an alias

This commit is contained in:
Simon Sapin 2019-02-08 14:54:22 +01:00
parent e544947278
commit 85f13f0d42
3 changed files with 97 additions and 36 deletions

View file

@ -78,7 +78,6 @@ use iter::{self, FusedIterator};
use ops::{self, Deref};
use rc::Rc;
use str::FromStr;
use string::ParseError;
use sync::Arc;
use ffi::{OsStr, OsString};
@ -1453,7 +1452,7 @@ impl From<String> for PathBuf {
#[stable(feature = "path_from_str", since = "1.32.0")]
impl FromStr for PathBuf {
type Err = ParseError;
type Err = core::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(PathBuf::from(s))