@@ -22,7 +22,12 @@ use crate::stm::{StmClosureResult, StmError, Transaction, atomically};
2222// not applied to orbit currently bc they are lazily onsumed, and therefore require dedicated
2323// instances to be robust
2424thread_local ! {
25- static AUXILIARIES : RefCell <( VecDeque <DartIdType >, HashSet <DartIdType >) > = RefCell :: new( ( VecDeque :: with_capacity( 10 ) , HashSet :: with_capacity( 10 ) ) ) ;
25+ static AUXILIARIES : RefCell <( VecDeque <DartIdType >, HashSet <DartIdType >) > = RefCell :: new(
26+ (
27+ VecDeque :: with_capacity( 10 ) ,
28+ HashSet :: with_capacity( 10 ) ,
29+ )
30+ ) ;
2631}
2732
2833/// **Beta-related methods**
@@ -138,6 +143,12 @@ impl<T: CoordsFloat> CMap3<T> {
138143 /// # Return
139144 ///
140145 /// Return a boolean indicating if the dart is 0-free, 1-free **and** 2-free.
146+ ///
147+ /// # Errors
148+ ///
149+ /// This method is meant to be called in a context where the returned `Result` is used to
150+ /// validate the transaction passed as argument. Errors should not be processed manually,
151+ /// only processed via the `?` operator.
141152 #[ must_use = "unused return value" ]
142153 pub fn is_free_tx ( & self , t : & mut Transaction , dart_id : DartIdType ) -> StmClosureResult < bool > {
143154 Ok ( self . beta_tx :: < 0 > ( t, dart_id) ? == NULL_DART_ID
@@ -417,6 +428,7 @@ impl<T: CoordsFloat> CMap3<T> {
417428 }
418429
419430 /// Return an iterator over IDs of all the map's vertices.
431+ #[ must_use = "iterators are lazy and do nothing unless consumed" ]
420432 pub fn par_iter_vertices ( & self ) -> impl ParallelIterator < Item = VertexIdType > + ' _ {
421433 ( 1 ..self . n_darts ( ) as DartIdType )
422434 . into_par_iter ( )
@@ -434,6 +446,7 @@ impl<T: CoordsFloat> CMap3<T> {
434446 }
435447
436448 /// Return an iterator over IDs of all the map's edges.
449+ #[ must_use = "iterators are lazy and do nothing unless consumed" ]
437450 pub fn par_iter_edges ( & self ) -> impl ParallelIterator < Item = EdgeIdType > + ' _ {
438451 ( 1 ..self . n_darts ( ) as DartIdType )
439452 . into_par_iter ( )
@@ -451,6 +464,7 @@ impl<T: CoordsFloat> CMap3<T> {
451464 }
452465
453466 /// Return an iterator over IDs of all the map's faces.
467+ #[ must_use = "iterators are lazy and do nothing unless consumed" ]
454468 pub fn par_iter_faces ( & self ) -> impl ParallelIterator < Item = FaceIdType > + ' _ {
455469 ( 1 ..self . n_darts ( ) as DartIdType )
456470 . into_par_iter ( )
@@ -468,6 +482,7 @@ impl<T: CoordsFloat> CMap3<T> {
468482 }
469483
470484 /// Return an iterator over IDs of all the map's volumes.
485+ #[ must_use = "iterators are lazy and do nothing unless consumed" ]
471486 pub fn par_iter_volumes ( & self ) -> impl ParallelIterator < Item = VolumeIdType > + ' _ {
472487 ( 1 ..self . n_darts ( ) as DartIdType )
473488 . into_par_iter ( )
0 commit comments