Move Filterable::Schema::try_from out of TryFrom
- Id
- 8073c3f4de3c614aeb90c1500311759f0b7954fa
- Author
- Caio
- Commit time
- 2020-02-08T11:34:47+01:00
Modified cantine_derive/tests/filter_query.rs
-use std::convert::TryFrom;
-
use tantivy::{
schema::{SchemaBuilder, Value, FAST, INDEXED},
Document,
Modified cantine_derive/internal/src/lib.rs
type Error = tantivy::TantivyError;
fn try_from(schema: &tantivy::schema::Schema) -> Result<Self, Self::Error> {
- Ok(Self {
- #(#try_from_decls),*
- })
+ <#index_name>::try_from(schema)
}
}
}
new
+ }
+
+ pub fn try_from(schema: &tantivy::schema::Schema) -> tantivy::Result<Self> {
+ Ok(Self {
+ #(#try_from_decls),*
+ })
}
}
}