open-i18n / rust-unic

UNIC: Unicode and Internationalization Crates for Rust
https://crates.io/crates/unic
Other
234 stars 24 forks source link

Implement iterator for all assigned Unicode Blocks #227

Closed eyeplum closed 5 years ago

eyeplum commented 6 years ago

This pull request partially implements #206 by implementing a block iterator for all assigned Unicode Blocks.

eyeplum commented 6 years ago

Hey @behnam I know you were working on #206 , but I needed this in my project so I also tried to implement this.

Feel free to close this PR if it can be covered by your work, or just take the useful parts.

Cheers!

eyeplum commented 6 years ago

Thanks @behnam , I will rebase and update the PR!

behnam commented 5 years ago

Awesome! Looks great!

bors: r+

behnam commented 5 years ago

Oh, we need to fix master on beta/nightly first. A bunch of non-top-level use statements need a create:: prefix. (See https://travis-ci.org/open-i18n/rust-unic/jobs/439036265) Would be great if you could help with it. If not, I'll try to get to it later this week.

bors[bot] commented 5 years ago

Build failed

eyeplum commented 5 years ago

Sure, I'm keen to help. Will send pull request shortly.

eyeplum commented 5 years ago

Hey @behnam, I tried to fix those warnings for beta and nightly in #233, but looks like the preferred way is not supported by stable and 1.26.0, so I'm afraid we can't fix those warnings at the moment. The build failure in this pull request turns out to be some outdated lint annotations in ucd/block's lib.rs (I copied it from some other module at some point). I have aligned ucd/block's lint annotations with other modules, now this pull request should build 🤞.

behnam commented 5 years ago

Copying from the other PR (https://github.com/open-i18n/rust-unic/pull/233):

Oh, I thought master is broken. Apparently it's not, but the builds here were failing because of the new code was based on the code before we allow warnings again.

So, let's just crate:: prefixes and all should be fine now. Right?

eyeplum commented 5 years ago

but the builds here were failing because of the new code was based on the code before we allow warnings again

Exactly, those build errors were actually warnings to warn us about that new compilers will drop support for top level use statements without prefixes (because of #![forbid(future_incompatible)]).

So, let's just crate:: prefixes and all should be fine now. Right?

The crate:: prefixes are not supported by stable and 1.26.0, so we can't do this now. What I have done in 746a58d is to make future_incompatible a warning instead of an error.

And yes, now this pull request is good to merge (it passed all Travis CI and AppVeyor checks).

behnam commented 5 years ago

bors: r+

bors[bot] commented 5 years ago

Build succeeded