From 51350d90092b3099630e2fd98bfb0935cf7b0945 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 1 Jan 2021 19:23:20 -0800 Subject: use FromStr --- src/path.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/path.rs b/src/path.rs index c566b9c..570b8ef 100644 --- a/src/path.rs +++ b/src/path.rs @@ -9,6 +9,9 @@ use crate::prelude::*; use crate::path::error::*; +use std::str::FromStr; + + lalrpop_mod!(pub parser, "/path/parser.rs"); pub mod error; @@ -149,7 +152,7 @@ impl std::fmt::Display for GenericPathComponent { } -impl std::str::FromStr for FileName { +impl FromStr for FileName { type Err = FileNameError; fn from_str(input: &str) -> std::result::Result { @@ -162,7 +165,7 @@ impl std::str::FromStr for FileName { } -impl std::str::FromStr for DirectoryName { +impl FromStr for DirectoryName { type Err = DirectoryNameError; fn from_str(input: &str) -> std::result::Result { @@ -175,7 +178,7 @@ impl std::str::FromStr for DirectoryName { } -impl std::str::FromStr for GenericPathComponent { +impl FromStr for GenericPathComponent { type Err = PathError; fn from_str(input: &str) -> std::result::Result { -- cgit 1.4.1