Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl Error for EncodeUtf8Error, and add a fallback description method #17

Merged
merged 5 commits into from
Feb 7, 2017

Conversation

burtonageo
Copy link
Contributor

No description provided.

src/char.rs Outdated

#[cfg(not(feature = "std"))]
impl EncodeUtf8Error {
fn description(&self) -> &str {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method seems to be extra, it's not needed?

Copy link
Contributor Author

@burtonageo burtonageo Feb 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Error trait is a std-only trait. I added this method as a fallback for when std is not enabled.

The ascii crate uses a similar technique with its error types.

@bluss
Copy link
Owner

bluss commented Feb 5, 2017

Right, it wasn't pub so I didn't understand. The intrinsic method must not be inversely conditional, that is not compatible with crate versioning and features. "std" is an additive feature and can not take anything away. Could just just put the string definition without const inside the intrinsic description method? Thanks

@bluss bluss merged commit 7b568d6 into bluss:master Feb 7, 2017
@bluss
Copy link
Owner

bluss commented Feb 7, 2017

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants