pub fn add_directory<S>(&mut self, name: S, mut options: FileOptions) -> ZipResult<()>
    where
        S: Into<String>,
    {
        if options.permissions.is_none() {
            options.permissions = Some(0o755);
        }
        *options.permissions.as_mut().unwrap() |= 0o40000;
        options.compression_method = CompressionMethod::Stored;

        let name_as_string = name.into();
        // Append a slash to the filename if it does not end with it.
        let name_with_slash = match name_as_string.chars().last() {
            Some('/') | Some('\\') => name_as_string,
            _ => name_as_string + "/",
        };

        self.start_entry(name_with_slash, options, None)?;
        self.writing_to_file = false;
        Ok(())
    }
/// Add a directory entry.
///
/// You can't write data to the file afterwards.
Add a directory entry.
You can't write data to the file afterwards.
Add a directory entry . You can ' t write data to the file afterwards .
pub fn add_directory<S>(&mut self, name: S, mut options: FileOptions) -> ZipResult<()>
    where
        S: Into<String>,
    {
        if options.permissions.is_none() {
            options.permissions = Some(0o755);
        }
        *options.permissions.as_mut().unwrap() |= 0o40000;
        options.compression_method = CompressionMethod::Stored;
        let name_as_string = name.into();
        // Append a slash to the filename if it does not end with it.
        let name_with_slash = match name_as_string.chars().last() {
            Some('/') | Some('\\') => name_as_string,
            _ => name_as_string + "/",
        };
        self.start_entry(name_with_slash, options, None)?;
        self.writing_to_file = false;
        Ok(())
    }
pub fn add_directory < S > ( & mut self , name : S , mut options : FileOptions ) -> ZipResult < ( ) > where S : Into < String > , { if options . permissions . is_none ( ) { options . permissions = Some ( 0o755 ) ; } * options . permissions . as_mut ( ) . unwrap ( ) |= 0o40000 ; options . compression_method = CompressionMethod :: Stored ; let name_as_string = name . into ( ) ; // Append a slash to the filename if it does not end with it. let name_with_slash = match name_as_string . chars ( ) . last ( ) { Some ( '/' ) | Some ( '\\' ) => name_as_string , _ => name_as_string + " " , } ; self . start_entry ( name_with_slash , options , None ) ? ; self . writing_to_file = false ; Ok ( ( ) ) }
Add a directory entry.
Add a directory entry .
&mut self
name
S
options
FileOptions
&mut self
name
S
options
FileOptions