mirror of
https://github.com/chronotope/chrono.git
synced 2025-09-28 13:31:35 +00:00
Remove Not impls for WeekdaySet and Weekday
This commit is contained in:
parent
cac4e8cf8d
commit
4094865116
@ -1,7 +1,6 @@
|
||||
use core::{
|
||||
fmt::{self, Debug},
|
||||
iter::FusedIterator,
|
||||
ops::Not,
|
||||
};
|
||||
|
||||
use crate::Weekday;
|
||||
@ -419,28 +418,12 @@ impl fmt::Display for WeekdaySet {
|
||||
}
|
||||
}
|
||||
|
||||
impl Not for WeekdaySet {
|
||||
type Output = Self;
|
||||
|
||||
fn not(self) -> Self::Output {
|
||||
Self(self.0 ^ 0b0111_1111)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromIterator<Weekday> for WeekdaySet {
|
||||
fn from_iter<T: IntoIterator<Item = Weekday>>(iter: T) -> Self {
|
||||
iter.into_iter().map(Self::single).fold(Self::EMPTY, Self::union)
|
||||
}
|
||||
}
|
||||
|
||||
impl Not for Weekday {
|
||||
type Output = WeekdaySet;
|
||||
|
||||
fn not(self) -> Self::Output {
|
||||
!WeekdaySet::single(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::Weekday;
|
||||
@ -475,13 +458,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn not_operation_preserves_8th_bit_invariant() {
|
||||
for days in WeekdaySet::iter_all() {
|
||||
assert_8th_bit_invariant(!days);
|
||||
}
|
||||
}
|
||||
|
||||
/// Test `split_at` on all possible arguments.
|
||||
#[test]
|
||||
fn split_at_is_equivalent_to_iterating() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user