mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-23 02:29:57 +00:00
add From impl to BoxTokenStream, Bump tokenizer-api version
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tantivy-tokenizer-api"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
license = "MIT"
|
||||
edition = "2021"
|
||||
description = "Tokenizer API of tantivy"
|
||||
|
||||
@@ -63,6 +63,12 @@ pub trait Tokenizer: 'static + Clone + Send + Sync {
|
||||
/// Simple wrapper of `Box<dyn TokenStream + 'a>`.
|
||||
pub struct BoxTokenStream<'a>(Box<dyn TokenStream + 'a>);
|
||||
|
||||
impl<'a> From<BoxTokenStream<'a>> for Box<dyn TokenStream + 'a> {
|
||||
fn from(token_stream: BoxTokenStream<'a>) -> Self {
|
||||
token_stream.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<T> for BoxTokenStream<'a>
|
||||
where T: TokenStream + 'a
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user