Skip to content

Make unicode normalization optional #85

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elsirion
Copy link

@elsirion elsirion commented May 26, 2025

Potential solution for #28 (comment)

With default features this is the dependency tree now:

bip39 v2.1.0 (/home/user/projects/elsirion/rust-bip39)
├── bitcoin_hashes v0.13.0
│   ├── bitcoin-internals v0.2.0
│   └── hex-conservative v0.1.2
├── rand v0.8.5
│   ├── libc v0.2.162
│   ├── rand_chacha v0.3.1
│   │   ├── ppv-lite86 v0.2.20
│   │   │   └── zerocopy v0.7.35
│   │   │       ├── byteorder v1.5.0
│   │   │       └── zerocopy-derive v0.7.35 (proc-macro)
│   │   │           ├── proc-macro2 v1.0.89
│   │   │           │   └── unicode-ident v1.0.13
│   │   │           ├── quote v1.0.37
│   │   │           │   └── proc-macro2 v1.0.89 (*)
│   │   │           └── syn v2.0.87
│   │   │               ├── proc-macro2 v1.0.89 (*)
│   │   │               ├── quote v1.0.37 (*)
│   │   │               └── unicode-ident v1.0.13
│   │   └── rand_core v0.6.4
│   │       └── getrandom v0.2.15
│   │           ├── cfg-if v1.0.0
│   │           └── libc v0.2.162
│   └── rand_core v0.6.4 (*)
├── rand_core v0.6.4 (*)
└── serde v1.0.214

@elsirion elsirion force-pushed the 2025-05-normalization branch from e64a0d5 to 93330e9 Compare May 26, 2025 23:33
Comment on lines +22 to +28
chinese-simplified = [ "unicode-normalization" ]
chinese-traditional = [ "unicode-normalization" ]
czech = []
french = []
italian = []
japanese = []
korean = []
japanese = [ "unicode-normalization" ]
korean = [ "unicode-normalization" ]
Copy link
Author

Choose a reason for hiding this comment

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

Idk if that's the right way to go about it, but it seems reasonable to want UN if you are dealing with these languages. I can also make it an entirely optional feature, which is cleaner but imo risks misuse.

rand = [ "crate_rand", "rand_core" ]
alloc = [ "unicode-normalization" ]
alloc = []
unicode-normalization = [ "dep:unicode-normalization", "alloc" ]

Choose a reason for hiding this comment

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

doesn't work in old rust

Copy link

Choose a reason for hiding this comment

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

@stevenroose What was the ancient Rust version we need to get it to work on? :D

Copy link

Choose a reason for hiding this comment

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

@elsirion I guess we don't really need to use dep: which is somehow recent addition.

And we can have unicode-normalization-std to avoid using ?.

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.

3 participants