chore: rustfmt
This commit is contained in:
parent
ae941ad256
commit
b080731c55
2 changed files with 20 additions and 23 deletions
14
src/lib.rs
14
src/lib.rs
|
@ -6,21 +6,21 @@
|
||||||
//! archives.
|
//! archives.
|
||||||
//!
|
//!
|
||||||
//! The current implementation is based on [PKWARE's APPNOTE.TXT v6.3.9](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT)
|
//! The current implementation is based on [PKWARE's APPNOTE.TXT v6.3.9](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT)
|
||||||
//!
|
//!
|
||||||
//! ---
|
//! ---
|
||||||
//!
|
//!
|
||||||
//! [`zip`](`crate`) has support for the most common ZIP archives found in common use.
|
//! [`zip`](`crate`) has support for the most common ZIP archives found in common use.
|
||||||
//! However, in special cases,
|
//! However, in special cases,
|
||||||
//! there are some zip archives that are difficult to read or write.
|
//! there are some zip archives that are difficult to read or write.
|
||||||
//!
|
//!
|
||||||
//! This is a list of supported features:
|
//! This is a list of supported features:
|
||||||
//!
|
//!
|
||||||
//! | | Reading | Writing |
|
//! | | Reading | Writing |
|
||||||
//! | ------- | ------ | ------- |
|
//! | ------- | ------ | ------- |
|
||||||
//! | Deflate | ✅ [->](`crate::ZipArchive::by_name`) | ✅ [->](`crate::write::FileOptions::compression_method`) |
|
//! | Deflate | ✅ [->](`crate::ZipArchive::by_name`) | ✅ [->](`crate::write::FileOptions::compression_method`) |
|
||||||
//!
|
//!
|
||||||
//!
|
//!
|
||||||
//!
|
//!
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
|
|
29
src/types.rs
29
src/types.rs
|
@ -1,9 +1,6 @@
|
||||||
//! Types that specify what is contained in a ZIP.
|
//! Types that specify what is contained in a ZIP.
|
||||||
#[cfg(doc)]
|
#[cfg(doc)]
|
||||||
use {
|
use {crate::read::ZipFile, crate::write::FileOptions};
|
||||||
crate::read::ZipFile,
|
|
||||||
crate::write::FileOptions,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg(feature = "time")]
|
#[cfg(feature = "time")]
|
||||||
use time::{error::ComponentRange, Date, Month, OffsetDateTime, PrimitiveDateTime, Time};
|
use time::{error::ComponentRange, Date, Month, OffsetDateTime, PrimitiveDateTime, Time};
|
||||||
|
@ -28,7 +25,7 @@ impl System {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Representation of a moment in time.
|
/// Representation of a moment in time.
|
||||||
///
|
///
|
||||||
/// Zip files use an old format from DOS to store timestamps,
|
/// Zip files use an old format from DOS to store timestamps,
|
||||||
/// with its own set of peculiarities.
|
/// with its own set of peculiarities.
|
||||||
/// For example, it has a resolution of 2 seconds!
|
/// For example, it has a resolution of 2 seconds!
|
||||||
|
@ -37,7 +34,7 @@ impl System {
|
||||||
/// or read from one with [`ZipFile::last_modified`]
|
/// or read from one with [`ZipFile::last_modified`]
|
||||||
///
|
///
|
||||||
/// # Warning
|
/// # Warning
|
||||||
///
|
///
|
||||||
/// Because there is no timezone associated with the [`DateTime`], they should ideally only
|
/// Because there is no timezone associated with the [`DateTime`], they should ideally only
|
||||||
/// be used for user-facing descriptions. This also means [`DateTime::to_time`] returns an
|
/// be used for user-facing descriptions. This also means [`DateTime::to_time`] returns an
|
||||||
/// [`OffsetDateTime`] (which is the equivalent of chrono's `NaiveDateTime`).
|
/// [`OffsetDateTime`] (which is the equivalent of chrono's `NaiveDateTime`).
|
||||||
|
@ -175,45 +172,45 @@ impl DateTime {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the month, where 1 = january and 12 = december
|
/// Get the month, where 1 = january and 12 = december
|
||||||
///
|
///
|
||||||
/// # Warning
|
/// # Warning
|
||||||
///
|
///
|
||||||
/// When read from a zip file, this may not be a reasonable value
|
/// When read from a zip file, this may not be a reasonable value
|
||||||
pub fn month(&self) -> u8 {
|
pub fn month(&self) -> u8 {
|
||||||
self.month
|
self.month
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the day
|
/// Get the day
|
||||||
///
|
///
|
||||||
/// # Warning
|
/// # Warning
|
||||||
///
|
///
|
||||||
/// When read from a zip file, this may not be a reasonable value
|
/// When read from a zip file, this may not be a reasonable value
|
||||||
pub fn day(&self) -> u8 {
|
pub fn day(&self) -> u8 {
|
||||||
self.day
|
self.day
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the hour
|
/// Get the hour
|
||||||
///
|
///
|
||||||
/// # Warning
|
/// # Warning
|
||||||
///
|
///
|
||||||
/// When read from a zip file, this may not be a reasonable value
|
/// When read from a zip file, this may not be a reasonable value
|
||||||
pub fn hour(&self) -> u8 {
|
pub fn hour(&self) -> u8 {
|
||||||
self.hour
|
self.hour
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the minute
|
/// Get the minute
|
||||||
///
|
///
|
||||||
/// # Warning
|
/// # Warning
|
||||||
///
|
///
|
||||||
/// When read from a zip file, this may not be a reasonable value
|
/// When read from a zip file, this may not be a reasonable value
|
||||||
pub fn minute(&self) -> u8 {
|
pub fn minute(&self) -> u8 {
|
||||||
self.minute
|
self.minute
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the second
|
/// Get the second
|
||||||
///
|
///
|
||||||
/// # Warning
|
/// # Warning
|
||||||
///
|
///
|
||||||
/// When read from a zip file, this may not be a reasonable value
|
/// When read from a zip file, this may not be a reasonable value
|
||||||
pub fn second(&self) -> u8 {
|
pub fn second(&self) -> u8 {
|
||||||
self.second
|
self.second
|
||||||
|
|
Loading…
Add table
Reference in a new issue