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

rollup and start preparing for a 1.0 release #104

Merged
merged 21 commits into from
Jul 6, 2022
Merged

rollup and start preparing for a 1.0 release #104

merged 21 commits into from
Jul 6, 2022

Conversation

BurntSushi
Copy link
Owner

Ref #40

@BurntSushi BurntSushi force-pushed the ag/work branch 4 times, most recently from 51405a9 to 1f77e5c Compare July 4, 2022 18:02
atouchet and others added 5 commits July 5, 2022 14:11
I chose this because it's what appears to be the version of Rust that
is in the current version of Debian stable (which is bullseye).

I don't necessarily plan to always track Debian stable, but in the
absence of any other constraint (like a strong desire to use something
stabilized in a more recent Rust release), it seems like a fine place
to sit.
I'm also trying to fix CI, which appears broken on macOS. The build
fails with zero logs, so that means it's time to just start changing
things until it works.
Allowing access to the buffer itself may make some use cases simpler
when access to the original buffer after consuming a few lines is
preferrable.

Without it, one would have to find a way to count the consumed bytes
themselves.

Closes #101
BurntSushi and others added 12 commits July 5, 2022 19:21
This re-generates all of the Unicode DFAs with Unicode 14.

Doing this update was a major pain:

1) Update ucd-generate to Unicode 14, cut release
2) Update regex-syntax to Unicode 14, cut release
3) Update ucd-generate to new regex-syntax, cut release
4) Update bstr by re-running Unicode generation shell script

*phew*
This is a more specific name given that we know we're dealing with a
'&[u8]'.
This implements 'ByteSlice::repeatn' with '<[u8]>::repeat'.

'repeat' on slices is stable since Rust 1.40.0 and does an exponential
'ptr::copy_nonoverlapping'. The implementation in 'alloc' also correctly
handles the capacity overflow when 'len * n' is more than 'usize::MAX'.

Closes #91
Previously, they would just return 'Vec<u8>' as the error type. But a
'FromUtf8Error' gives strictly more information, so we return that
instead.

Closes #52
This commit enables bstr to build and test without a dependency on std.
This change was mostly munging 'use' statements to prefer 'core' and
'alloc' and changing around some conditional compilation.

This change also enables bstr` to successfully test in 'no_std' and
'alloc' configurations. This includes doc tests. Previously, neither the
library nor doc tests worked right if 'std' was disabled.

Fixes #79, Closes #83
This doesn't change any behavior (I was wrong in #87), but instead
clarifies that empty bytesets are valid and never match anything.

Fixes #87
In a few places I must have got lazy when defining the iterator types
and forced haystacks and needles/splitters to always have the same
lifetime. This works in most cases, but #45 shows a case where it breaks
down. To fix it, we just make sure we represent all of our lifetimes in
our types.

Note that #45 was reported against our split types, but we also have
this issue with our find types too. Indeed, our split types are built on
top of our find types, so we just fix everything.

This is a breaking change since we are adding a new lifetime parameter
to several public API types.

Fixes #45
Our pattern has been to group forward/reverse APIs together, but the
split_once APIs were put between 'split_str' and 'rsplit_str'. So we
move them both below 'rsplit_str'.
It currently uses 'char::is_whitespace', but this is more of an
implementation detail. While 'char::is_whitespace' is available in
'core', it's plausible that we might use our own data some data. In
particular, 'trim' already uses its own data.

I believe this is the only routine that makes direct use of some kind of
Unicode data that wasn't previously gated behind the 'unicode' feature.

Ref #40
This switches over to using as fewer 'use' statements. We don't go with
the minimal number though, since I still find it useful to split 'use'
statements into logical blocks: core, alloc, std, third party, crate.
It's nice to reserve 'pub' strictly for things that are part of the
public API, as a way of making it easy to see which things are and
aren't part of the API.

I'm sure there are more 'pub' things that we should make 'pub(crate)',
but this one stood out to me.
@BurntSushi BurntSushi merged commit 0d9d222 into master Jul 6, 2022
@BurntSushi BurntSushi deleted the ag/work branch July 6, 2022 00:40
This was referenced Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants