summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-07-07 21:22:30 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-07-07 21:22:30 +0100
commit7505f91e557daac82c9478ea2783ca703d798ac7 (patch)
treeabc46070a38bf041729eb56246bc6380c65a20bb
parent8fdb14af2e8c6951251d7104245fbf5951db110e (diff)
downloadparsebyregex-7505f91e557daac82c9478ea2783ca703d798ac7.tar.bz2
Tidy up a bit
-rw-r--r--parsebyregex-derive/tests/basic.rs2
-rw-r--r--parsebyregex-example/src/main.rs2
-rw-r--r--rust-toolchain1
-rw-r--r--src/lib.rs5
4 files changed, 4 insertions, 6 deletions
diff --git a/parsebyregex-derive/tests/basic.rs b/parsebyregex-derive/tests/basic.rs
index 16cdefd..fab6911 100644
--- a/parsebyregex-derive/tests/basic.rs
+++ b/parsebyregex-derive/tests/basic.rs
@@ -8,7 +8,7 @@ struct Person {
pub age: u32,
}
-fn main() -> Result<(), Box<std::error::Error>> {
+fn main() -> Result<(), Box<dyn std::error::Error>> {
let person: Person = Person::parse_by_regex("age=14")?;
assert_eq!(person.age, 14);
Ok(())
diff --git a/parsebyregex-example/src/main.rs b/parsebyregex-example/src/main.rs
index 96d4d83..5defbc4 100644
--- a/parsebyregex-example/src/main.rs
+++ b/parsebyregex-example/src/main.rs
@@ -52,7 +52,7 @@ static TEST_INPUT: &str = r#"
[1518-11-05 00:55] wakes up
"#;
-fn main() -> Result<(), Box<std::error::Error>> {
+fn main() -> Result<(), Box<dyn std::error::Error>> {
let input: Result<Vec<Entry>, _> = TEST_INPUT
.trim()
.lines()
diff --git a/rust-toolchain b/rust-toolchain
deleted file mode 100644
index 65b2df8..0000000
--- a/rust-toolchain
+++ /dev/null
@@ -1 +0,0 @@
-beta
diff --git a/src/lib.rs b/src/lib.rs
index 39f26ca..abbb2fd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -14,7 +14,7 @@ pub use regex::Regex;
/// If this is implemented then you can parse things by regular expression
/// just like `FromStr`.
pub trait ParseByRegex: Sized {
- fn parse_by_regex<T: AsRef<str>>(input: T) -> Result<Self, Box<Error>>;
+ fn parse_by_regex<T: AsRef<str>>(input: T) -> Result<Self, Box<dyn Error>>;
}
impl<TY> ParseByRegex for TY
@@ -22,7 +22,7 @@ where
TY: FromStr,
<TY as FromStr>::Err: Error + 'static,
{
- fn parse_by_regex<T: AsRef<str>>(input: T) -> Result<Self, Box<Error>> {
+ fn parse_by_regex<T: AsRef<str>>(input: T) -> Result<Self, Box<dyn Error>> {
Ok(<Self as FromStr>::from_str(input.as_ref())?)
}
}
@@ -36,5 +36,4 @@ mod tests {
assert!(f.is_ok());
assert_eq!(f.unwrap(), 1);
}
-
}