/// Updates content of the module-specific directory of the local copy.
///
/// If something goes wrong, logs a message.
Updates content of the module-specific directory of the local copy.
If something goes wrong, logs a message.
Updates content of the module - specific directory of the local copy . If something goes wrong logs a message .
fn update_module(&self, host: Bytes, path: PathBuf) {
        let dir = match fs::read_dir(&path) {
            Ok(dir) => dir,
            Err(err) => {
                warn!(
                    "Failed to read directory {}: {}.",
                    path.display(), err
                );
                return
            }
        };
        for entry in dir {
            let entry = match entry {
                Ok(entry) => entry,
                Err(err) => {
                    warn!(
                        "Failed to iterate over directory {}: {}",
                        path.display(), err
                    );
                    // XXX Or continue?
                    return
                }
            };
            if !entry.file_type().map(|t| t.is_dir()).unwrap_or(false) {
                warn!(
                    "{}: unexpected file. Skipping.",
                    entry.path().display()
                );
                continue
            }
            match entry_to_uri_component(&entry) {
                Some(module) => {
                    self.rsync_module(
                        &uri::RsyncModule::new(host.clone(), module)
                    )
                }
                None => {
                    warn!(
                        "{}: illegal module directory. Skipping",
                        entry.path().display()
                    )
                }
            }
        }
    }
fn update_module ( & self , host : Bytes , path : PathBuf ) { let dir = match fs :: read_dir ( & path ) { Ok ( dir ) => dir , Err ( err ) => { warn ! ( " " path display ( ) err ) ; return } } ; for entry in dir { let entry = match entry { Ok ( entry ) => entry , Err ( err ) => { warn ! ( " " path display ( ) err ) ; // XXX Or continue? return } } ; if ! entry . file_type ( ) . map ( | t | t . is_dir ( ) ) . unwrap_or ( false ) { warn ! ( " " entry path ( ) display ( ) ) ; continue } match entry_to_uri_component ( & entry ) { Some ( module ) => { self . rsync_module ( & uri :: RsyncModule :: new ( host . clone ( ) , module ) ) } None => { warn ! ( " " entry path ( ) display ( ) ) } } } }
Updates content of the module-specific directory of the local copy.
Updates content of the module - specific directory of the local copy .
&self
host
Bytes
path
PathBuf