Added trait implementations to ParseQuantityError#217
Closed
Lucretiel wants to merge 2 commits into
Closed
Conversation
Owner
|
Thanks for the PR! I'm planning to review this weekend. |
Owner
|
Couple minor fixes. If you can review, apply, and then squash your commits I'll merge!
diff --git a/src/lib.rs b/src/lib.rs
index 29115c9..efc91d4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -621,10 +621,7 @@ pub mod fmt {
/// Unicode string slice manipulation for quantities.
pub mod str {
- use core::fmt::{self, Display, Formatter};
-
- #[cfg(feature = "std")]
- use std::error::Error;
+ use crate::lib::fmt::{self, Display, Formatter};
/// Represents an error encountered while parsing a string into a `Quantity`.
#[allow(missing_copy_implementations)]
@@ -654,11 +651,11 @@ pub mod str {
match *self {
NoSeparator => write!(f, "no space between quantity and units"),
ValueParseError => write!(f, "error parsing unit quantity"),
- UnknownUnit => write!(f, "unrecognized parsing unit of measure"),
+ UnknownUnit => write!(f, "unrecognized unit of measure"),
}
}
}
#[cfg(feature = "std")]
- impl Error for ParseQuantityError {}
+ impl crate::lib::error::Error for ParseQuantityError {}
} |
Contributor
Author
|
Thanks for the review! Been busy, will follow up this weekend |
Owner
|
I ended up applying the patch along with |
iliekturtles
added a commit
that referenced
this pull request
Nov 25, 2020
Add trait implementations to ParseQuantityError.
Owner
|
Manually merged. Thanks so much for the PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.