You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: clear_hyperedges.rs
    path of file: ./repos/hypergraph/src/core/hyperedges
    
    the code of the file until where you have to start completion: use rayon::prelude::*;

use crate::{
    bi_hash_map::BiHashMap, errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexTrait,
};

impl<V, HE> Hypergraph<V, HE>
where
    V: VertexTrait,
    HE: HyperedgeTrait,
{
    /// Clears all the hyperedges from the hyp
    
    pub fn clear_hyperedges(&mut self) -> Result<(), HypergraphError<V, HE>> {
        // Clear the set while keeping its capacity.
        self.hyperedges.clear();

        // Reset the hyperedges mapping.
        self.hyperedges_mapping = BiHashMap::default();

        // Reset the hyperedges counter.
        self.hyperedges_count = 0;

        // Update the vertices accordingly.
        self.vertices
            .par_iter_mut()
            // Clear the sets while keeping their capacities.
            .for_each(|(_, hyperedges)| hyperedges.clear());

        Ok(())
    }