fn activity_folder(&self, path: &Path) -> Result<ActivityFolder, StorageError> {
        let storage_pool = self.storage_pool();

        for (i, (_id, storage)) in storage_pool.iter().enumerate() {
            // Find activity folder
            if let Some(folder) = self.find_folder_recursive(path, storage, None)? {
                println!(
                    "Found {} folder on Storage {}:",
                    path.to_string_lossy(),
                    i + 1
                );
                println!(
                    "  Description: {}",
                    storage.description().unwrap_or("Unknown")
                );
                println!(
                    "  Max. capacity: {}",
                    bytefmt::format(storage.maximum_capacity())
                );
                println!(
                    "  Free space: {}",
                    bytefmt::format(storage.free_space_in_bytes())
                );
                return Ok(ActivityFolder {
                    storage_id: storage.id(),
                    parent: Parent::Folder(folder.id()),
                });
            }
        }

        Err(StorageError::FolderNotFound(
            "Activity folder not found".to_string(),
        ))
    }
// TODO: Handle multiple storages with identical folders
Handle multiple storages with identical folders
Handle multiple storages with identical folders
fn activity_folder(&self, path: &Path) -> Result<ActivityFolder, StorageError> {
        let storage_pool = self.storage_pool();
        for (i, (_id, storage)) in storage_pool.iter().enumerate() {
            // Find activity folder
            if let Some(folder) = self.find_folder_recursive(path, storage, None)? {
                println!(
                    "Found {} folder on Storage {}:",
                    path.to_string_lossy(),
                    i + 1
                );
                println!(
                    "  Description: {}",
                    storage.description().unwrap_or("Unknown")
                );
                println!(
                    "  Max. capacity: {}",
                    bytefmt::format(storage.maximum_capacity())
                );
                println!(
                    "  Free space: {}",
                    bytefmt::format(storage.free_space_in_bytes())
                );
                return Ok(ActivityFolder {
                    storage_id: storage.id(),
                    parent: Parent::Folder(folder.id()),
                });
            }
        }
        Err(StorageError::FolderNotFound(
            "Activity folder not found".to_string(),
        ))
    }
fn activity_folder ( & self , path : & Path ) -> Result < ActivityFolder , StorageError > { let storage_pool = self . storage_pool ( ) ; for ( i , ( _id , storage ) ) in storage_pool . iter ( ) . enumerate ( ) { // Find activity folder if let Some ( folder ) = self . find_folder_recursive ( path , storage , None ) ? { println ! ( " " path to_string_lossy ( ) i 1 ) ; println ! ( " " storage description ( ) unwrap_or ( " " ) ) ; println ! ( " " bytefmt format ( storage maximum_capacity ( ) ) ) ; println ! ( " " bytefmt format ( storage free_space_in_bytes ( ) ) ) ; return Ok ( ActivityFolder { storage_id : storage . id ( ) , parent : Parent :: Folder ( folder . id ( ) ) , } ) ; } } Err ( StorageError :: FolderNotFound ( " " . to_string ( ) , ) ) }
TODO: Handle multiple storages with identical folders
TODO : Handle multiple storages with identical folders
&self
path
&Path