-
Notifications
You must be signed in to change notification settings - Fork 10
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
Expose StreamState #1
Conversation
The feature is there by default and just enables the `mmap` feature in the fst crate when enabled. Closes BurntSushi#70
The lazy_static 1.2 release increases the minimum Rust version, so we do the same.
Just fixing mardown. (The image didn't show on docs.rs, because of the newline.)
Reading the docs previously was a bit confusing ‒ while the nature of the operation hints at exactly one IndexValue, the interface hints at arbitrary number and the docs kind of did too and one has to wonder what the trick is. Pointing it out explicitly should prevent the latter. PR BurntSushi#76
It's like to_vec, but without making copies. The reason why it didn't already exist is because the &[u8] tends to be a memory map, or at the very least, could be a memory map. In that circumstance, getting access to the raw slice without needing to type unsafe would be bad. With that said, since the last release, constructing an FST from a memory map now requires typing unsafe. There is even a safe method called as_bytes on the MmapReadOnly type. So to that end, the absence of this method was likely an oversight, and should now be an okay addition. PR BurntSushi#77
These are useful for constructing sets/maps directly from raw bytes. PR BurntSushi#80
This adds ability to match exact strings against the given set, as well as enables trie usecase by combining it with `StartsWith<_>`. We could have implemented `Automaton` for `&[u8]`/`&str` directly, but this path is a bit more conservative for now. PR BurntSushi#79
src/lib.rs
Outdated
@@ -13,7 +15,7 @@ pub use error::{Error, Result}; | |||
pub use map::{Map, MapBuilder}; | |||
pub use stream::{IntoStreamer, Streamer}; | |||
|
|||
mod regex; | |||
pub mod regex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you added that to fix a doctest. This is not needed. The problem is fixed in master
src/map.rs
Outdated
type Item = (&'a [u8], u64, A::State); | ||
|
||
fn next(&'a mut self) -> Option<Self::Item> { | ||
/// My IDE Does not like this, and if I pub this function the compile fails, I'm a bit confused |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this comment.
what did you mean by "pub" this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I write pub fn next(...)
instead of just fn next(...)
the code does not compile
PR From BurntSushi#61 retrofitted here.