Skip to content

Commit

Permalink
Added rustdoc for MultiFruit extract function (#1369)
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton authored and PSeitz committed May 12, 2022
1 parent 6da2402 commit 84869db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/collector/multi_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 84869db

Please sign in to comment.