Skip to content

Commit

Permalink
chore: rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Plecra committed Jan 23, 2022
1 parent ae941ad commit b080731
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
//! archives.
//!
//! 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.
//! However, in special cases,
//! there are some zip archives that are difficult to read or write.
//!
//!
//! This is a list of supported features:
//!
//!
//! | | Reading | Writing |
//! | ------- | ------ | ------- |
//! | Deflate | ✅ [->](`crate::ZipArchive::by_name`) | ✅ [->](`crate::write::FileOptions::compression_method`) |
//!
//!
//!
//!
//!
//!

#![warn(missing_docs)]

Expand Down
29 changes: 13 additions & 16 deletions src/types.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
//! Types that specify what is contained in a ZIP.
#[cfg(doc)]
use {
crate::read::ZipFile,
crate::write::FileOptions,
};
use {crate::read::ZipFile, crate::write::FileOptions};

#[cfg(feature = "time")]
use time::{error::ComponentRange, Date, Month, OffsetDateTime, PrimitiveDateTime, Time};
Expand All @@ -28,7 +25,7 @@ impl System {
}

/// Representation of a moment in time.
///
///
/// Zip files use an old format from DOS to store timestamps,
/// with its own set of peculiarities.
/// For example, it has a resolution of 2 seconds!
Expand All @@ -37,7 +34,7 @@ impl System {
/// or read from one with [`ZipFile::last_modified`]
///
/// # Warning
///
///
/// 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
/// [`OffsetDateTime`] (which is the equivalent of chrono's `NaiveDateTime`).
Expand Down Expand Up @@ -175,45 +172,45 @@ impl DateTime {
}

/// Get the month, where 1 = january and 12 = december
///
///
/// # Warning
///
///
/// When read from a zip file, this may not be a reasonable value
pub fn month(&self) -> u8 {
self.month
}

/// Get the day
///
///
/// # Warning
///
///
/// When read from a zip file, this may not be a reasonable value
pub fn day(&self) -> u8 {
self.day
}

/// Get the hour
///
///
/// # Warning
///
///
/// When read from a zip file, this may not be a reasonable value
pub fn hour(&self) -> u8 {
self.hour
}

/// Get the minute
///
///
/// # Warning
///
///
/// When read from a zip file, this may not be a reasonable value
pub fn minute(&self) -> u8 {
self.minute
}

/// Get the second
///
///
/// # Warning
///
///
/// When read from a zip file, this may not be a reasonable value
pub fn second(&self) -> u8 {
self.second
Expand Down

0 comments on commit b080731

Please sign in to comment.