mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-17 06:22:54 +00:00
Added rustdoc for MultiFruit extract function (#1369)
This commit is contained in:
@@ -87,6 +87,10 @@ pub struct FruitHandle<TFruit: Fruit> {
|
||||
}
|
||||
|
||||
impl<TFruit: Fruit> FruitHandle<TFruit> {
|
||||
// Extract a typed fruit off a multifruit.
|
||||
//
|
||||
// This function involves downcasting and can panic if the multifruit was
|
||||
// created using faulty code.
|
||||
pub fn extract(self, fruits: &mut MultiFruit) -> TFruit {
|
||||
let boxed_fruit = fruits.sub_fruits[self.pos].take().expect("");
|
||||
*boxed_fruit
|
||||
|
||||
Reference in New Issue
Block a user