Skip to content

Make utf8parse dependency optional#219

Closed
mondeja wants to merge 1 commit intorust-cli:mainfrom
mondeja:utf8parse-optional
Closed

Make utf8parse dependency optional#219
mondeja wants to merge 1 commit intorust-cli:mainfrom
mondeja:utf8parse-optional

Conversation

@mondeja
Copy link

@mondeja mondeja commented Oct 17, 2024

Makes the utf8parse dependency optional without introducing breaking changes. So I can use in my crate:

anstream = { version = "0.6", default-features = false, features = ["auto", "wincon"] }

and the utf8parse dependency will not be downloaded.

Comment on lines +177 to 179
#[cfg(feature = "utf8")]
#[inline]
pub fn strip_bytes(data: &[u8]) -> StrippedBytes<'_> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Taking built-in functionality and putting it behind a feature is a breaking change as it may break people who use default-features = false

default = ["auto", "wincon", "utf8"]
auto = ["dep:anstyle-query"]
wincon = ["dep:anstyle-wincon"]
utf8 = ["dep:utf8parse", "anstyle-parse/utf8"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This feature name doesn't do a good job of describing what you are getting / losing imo

default = ["auto", "wincon", "utf8"]
auto = ["dep:anstyle-query"]
wincon = ["dep:anstyle-wincon"]
utf8 = ["dep:utf8parse", "anstyle-parse/utf8"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

In general, I worry that this is an implementation detail and could change and you could lose the benefit

@epage
Copy link
Collaborator

epage commented Oct 18, 2024

While I've started responding, the core of this really should be discussed in an issue per our contributing guidelines

Already have an idea? It might be good to first create an issue to propose it so we can make sure we are aligned and lower the risk of having to re-work some of it and the discouragement that goes along with that.

I'm going to go ahead and close in favor of an issue. What I would recommend focusing the issue on is why this is a problem. As-is, I'm not convinced this is worth doing.

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