Skip to content

Commit

Permalink
Address lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpratt committed Sep 19, 2023
1 parent 5b48552 commit 6248992
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
1 change: 1 addition & 0 deletions time-macros/src/lib.rs
Expand Up @@ -68,6 +68,7 @@ enum FormatDescriptionVersion {
#[cfg(any(feature = "formatting", feature = "parsing"))]
enum VersionOrModuleName {
Version(FormatDescriptionVersion),
#[cfg_attr(not(feature = "serde"), allow(unused_tuple_struct_fields))]
ModuleName(Ident),
}

Expand Down
1 change: 1 addition & 0 deletions time-macros/src/quote.rs
Expand Up @@ -45,6 +45,7 @@ macro_rules! sym {
};
}

#[allow(unused_macro_rules)] // Varies by feature flag combination.
macro_rules! quote_inner {
// Base case
($ts:ident) => {};
Expand Down
1 change: 1 addition & 0 deletions time/src/error/mod.rs
Expand Up @@ -36,6 +36,7 @@ pub use parse_from_description::ParseFromDescription;
#[cfg(feature = "parsing")]
pub use try_from_parsed::TryFromParsed;

#[cfg(feature = "parsing")]
use crate::internal_macros::bug;

/// A unified error type for anything returned by a method in the time crate.
Expand Down
7 changes: 3 additions & 4 deletions time/src/format_description/well_known/iso8601/adt_hack.rs
Expand Up @@ -49,11 +49,10 @@ impl<const CONFIG: EncodedConfig> Iso8601<CONFIG> {
}

impl Config {
/// Encode the configuration, permitting it to be used as a const parameter of
/// [`Iso8601`](super::Iso8601).
/// Encode the configuration, permitting it to be used as a const parameter of [`Iso8601`].
///
/// The value returned by this method must only be used as a const parameter to
/// [`Iso8601`](super::Iso8601). Any other usage is unspecified behavior.
/// The value returned by this method must only be used as a const parameter to [`Iso8601`]. Any
/// other usage is unspecified behavior.
pub const fn encode(&self) -> EncodedConfig {
let mut bytes = [0; EncodedConfig::BITS as usize / 8];

Expand Down
2 changes: 1 addition & 1 deletion time/src/quickcheck.rs
Expand Up @@ -2,7 +2,7 @@
//!
//! This enables users to write tests such as this, and have test values provided automatically:
//!
//! ```
//! ```ignore
//! # #![allow(dead_code)]
//! use quickcheck::quickcheck;
//! use time::Date;
Expand Down
6 changes: 0 additions & 6 deletions time/src/utc_offset.rs
Expand Up @@ -207,12 +207,6 @@ impl UtcOffset {

/// Obtain the UTC offset as its hours, minutes, and seconds. The sign of all three components
/// will always match. A positive value indicates an offset to the east; a negative to the west.
///
/// ```rust
/// # use time_macros::offset;
/// assert_eq!(offset!(+1:02:03).as_hms(), (1, 2, 3));
/// assert_eq!(offset!(-1:02:03).as_hms(), (-1, -2, -3));
/// ```
#[cfg(feature = "quickcheck")]
pub(crate) const fn as_hms_ranged(self) -> (Hours, Minutes, Seconds) {
(self.hours, self.minutes, self.seconds)
Expand Down

0 comments on commit 6248992

Please sign in to comment.