File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ impl ColumnDoc {
2121 /// - name: `String` - the name of the column
2222 /// - doc: `Option<String>` the comment for the column
2323 #[ must_use]
24- pub fn new ( name : String , doc : Option < String > ) -> Self {
24+ pub const fn new ( name : String , doc : Option < String > ) -> Self {
2525 Self { name, doc }
2626 }
2727
@@ -134,7 +134,10 @@ impl TableDoc {
134134 /// # Errors
135135 /// - Will return [`DocError::ColumnNotFound`] if the expected table is not found
136136 pub fn column ( & self , name : & str ) -> Result < & ColumnDoc , DocError > {
137- self . columns ( ) . binary_search_by ( |c| c. name ( ) . cmp ( name) ) . map_or_else ( |_| Err ( DocError :: ColumnNotFound { name : name. to_owned ( ) } ) , |id| Ok ( & self . columns ( ) [ id] ) )
137+ self . columns ( ) . binary_search_by ( |c| c. name ( ) . cmp ( name) ) . map_or_else (
138+ |_| Err ( DocError :: ColumnNotFound { name : name. to_owned ( ) } ) ,
139+ |id| Ok ( & self . columns ( ) [ id] ) ,
140+ )
138141 }
139142
140143 /// Getter method for retrieving the table's [`Path`]
You can’t perform that action at this time.
0 commit comments