@@ -172,7 +172,11 @@ impl Folder {
172172 /// This function fetches the ID of the current workspace from the meta object,
173173 /// and uses this ID to fetch the actual workspace object.
174174 ///
175- pub fn get_workspace_info ( & self , workspace_id : & WorkspaceId , uid : Option < i64 > ) -> Option < Workspace > {
175+ pub fn get_workspace_info (
176+ & self ,
177+ workspace_id : & WorkspaceId ,
178+ uid : Option < i64 > ,
179+ ) -> Option < Workspace > {
176180 let txn = self . collab . transact ( ) ;
177181 self . body . get_workspace_info ( & txn, workspace_id, uid)
178182 }
@@ -205,8 +209,7 @@ impl Folder {
205209
206210 pub fn move_view ( & mut self , view_id : & ViewId , from : u32 , to : u32 , uid : i64 ) -> Option < Arc < View > > {
207211 let mut txn = self . collab . transact_mut ( ) ;
208- self . body
209- . move_view ( & mut txn, view_id, from, to, Some ( uid) )
212+ self . body . move_view ( & mut txn, view_id, from, to, Some ( uid) )
210213 }
211214
212215 /// Moves a nested view to a new location in the hierarchy.
@@ -323,14 +326,22 @@ impl Folder {
323326
324327 pub fn remove_all_my_favorite_sections ( & mut self , uid : i64 ) {
325328 let mut txn = self . collab . transact_mut ( ) ;
326- if let Some ( op) = self . body . section . section_op ( & txn, Section :: Favorite , Some ( uid) ) {
329+ if let Some ( op) = self
330+ . body
331+ . section
332+ . section_op ( & txn, Section :: Favorite , Some ( uid) )
333+ {
327334 op. clear ( & mut txn) ;
328335 }
329336 }
330337
331338 pub fn move_favorite_view_id ( & mut self , id : & str , prev_id : Option < & str > , uid : i64 ) {
332339 let mut txn = self . collab . transact_mut ( ) ;
333- if let Some ( op) = self . body . section . section_op ( & txn, Section :: Favorite , Some ( uid) ) {
340+ if let Some ( op) = self
341+ . body
342+ . section
343+ . section_op ( & txn, Section :: Favorite , Some ( uid) )
344+ {
334345 op. move_section_item_with_txn ( & mut txn, id, prev_id) ;
335346 }
336347 }
@@ -395,14 +406,22 @@ impl Folder {
395406
396407 pub fn remove_all_my_trash_sections ( & mut self , uid : i64 ) {
397408 let mut txn = self . collab . transact_mut ( ) ;
398- if let Some ( op) = self . body . section . section_op ( & txn, Section :: Trash , Some ( uid) ) {
409+ if let Some ( op) = self
410+ . body
411+ . section
412+ . section_op ( & txn, Section :: Trash , Some ( uid) )
413+ {
399414 op. clear ( & mut txn) ;
400415 }
401416 }
402417
403418 pub fn move_trash_view_id ( & mut self , id : & str , prev_id : Option < & str > , uid : i64 ) {
404419 let mut txn = self . collab . transact_mut ( ) ;
405- if let Some ( op) = self . body . section . section_op ( & txn, Section :: Trash , Some ( uid) ) {
420+ if let Some ( op) = self
421+ . body
422+ . section
423+ . section_op ( & txn, Section :: Trash , Some ( uid) )
424+ {
406425 op. move_section_item_with_txn ( & mut txn, id, prev_id) ;
407426 }
408427 }
@@ -467,14 +486,22 @@ impl Folder {
467486
468487 pub fn remove_all_my_private_sections ( & mut self , uid : i64 ) {
469488 let mut txn = self . collab . transact_mut ( ) ;
470- if let Some ( op) = self . body . section . section_op ( & txn, Section :: Private , Some ( uid) ) {
489+ if let Some ( op) = self
490+ . body
491+ . section
492+ . section_op ( & txn, Section :: Private , Some ( uid) )
493+ {
471494 op. clear ( & mut txn) ;
472495 }
473496 }
474497
475498 pub fn move_private_view_id ( & mut self , id : & str , prev_id : Option < & str > , uid : i64 ) {
476499 let mut txn = self . collab . transact_mut ( ) ;
477- if let Some ( op) = self . body . section . section_op ( & txn, Section :: Private , Some ( uid) ) {
500+ if let Some ( op) = self
501+ . body
502+ . section
503+ . section_op ( & txn, Section :: Private , Some ( uid) )
504+ {
478505 op. move_section_item_with_txn ( & mut txn, id, prev_id) ;
479506 }
480507 }
@@ -734,7 +761,8 @@ impl FolderBody {
734761 ) ;
735762 }
736763
737- if let Some ( fav_section) = section. section_op ( & txn, Section :: Favorite , Some ( folder_data. uid ) ) {
764+ if let Some ( fav_section) = section. section_op ( & txn, Section :: Favorite , Some ( folder_data. uid ) )
765+ {
738766 for ( uid, sections) in folder_data. favorites {
739767 fav_section. add_sections_for_user_with_txn ( & mut txn, & uid, sections) ;
740768 }
@@ -855,7 +883,10 @@ impl FolderBody {
855883 . iter ( )
856884 . map ( |view| view. as_ref ( ) . clone ( ) )
857885 . collect :: < Vec < View > > ( ) ;
858- for view in self . views . get_views_belong_to ( txn, & workspace_uuid, Some ( uid) ) {
886+ for view in self
887+ . views
888+ . get_views_belong_to ( txn, & workspace_uuid, Some ( uid) )
889+ {
859890 let mut all_views_in_workspace = vec ! [ ] ;
860891 self . get_view_recursively_with_txn (
861892 txn,
@@ -988,10 +1019,7 @@ impl FolderBody {
9881019 . and_then ( |uuid| self . views . get_view_with_txn ( txn, & uuid, uid) )
9891020 . and_then ( |root_view| {
9901021 let first_public_space_view_id_with_child = root_view. children . iter ( ) . find ( |space_id| {
991- match self
992- . views
993- . get_view_with_txn ( txn, & space_id. id , uid)
994- {
1022+ match self . views . get_view_with_txn ( txn, & space_id. id , uid) {
9951023 Some ( space_view) => {
9961024 let is_public_space = space_view
9971025 . space_info ( )
0 commit comments