@@ -32,7 +32,7 @@ impl<T: Clone + std::fmt::Debug> DefinitionsBuilder<T> {
32
32
}
33
33
}
34
34
35
- // Get a ReferenceId for the given reference string.
35
+ /// Get a ReferenceId for the given reference string.
36
36
// This ReferenceId can later be used to retrieve a definition
37
37
pub fn get_reference_id ( & mut self , reference : & str ) -> ReferenceId {
38
38
let next_id = self . definitions . len ( ) ;
@@ -51,7 +51,7 @@ impl<T: Clone + std::fmt::Debug> DefinitionsBuilder<T> {
51
51
}
52
52
}
53
53
54
- // Add a definition, returning the ReferenceId that maps to it
54
+ /// Add a definition, returning the ReferenceId that maps to it
55
55
pub fn add_definition ( & mut self , reference : String , value : T ) -> PyResult < ReferenceId > {
56
56
let next_id = self . definitions . len ( ) ;
57
57
match self . definitions . entry ( reference. clone ( ) ) {
@@ -69,8 +69,8 @@ impl<T: Clone + std::fmt::Debug> DefinitionsBuilder<T> {
69
69
}
70
70
}
71
71
72
- // Retrieve an item definition using a ReferenceId
73
- // Will raise an error if the definition for that reference does not yet exist
72
+ /// Retrieve an item definition using a ReferenceId
73
+ /// Will raise an error if the definition for that reference does not yet exist
74
74
pub fn get_definition ( & self , reference_id : ReferenceId ) -> PyResult < & T > {
75
75
let ( reference, def) = match self . definitions . iter ( ) . find ( |( _, def) | def. id == reference_id) {
76
76
Some ( v) => v,
@@ -85,7 +85,7 @@ impl<T: Clone + std::fmt::Debug> DefinitionsBuilder<T> {
85
85
}
86
86
}
87
87
88
- // Consume this Definitions into a vector of items, indexed by each items ReferenceId
88
+ /// Consume this Definitions into a vector of items, indexed by each items ReferenceId
89
89
pub fn finish ( self ) -> PyResult < Vec < T > > {
90
90
// We need to create a vec of defs according to the order in their ids
91
91
let mut defs: Vec < ( usize , T ) > = Vec :: new ( ) ;
0 commit comments