Skip to content

Commit

Permalink
fmt and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Dec 6, 2023
1 parent f823da1 commit 5af4569
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion utils/calendrical_calculations/src/chinese_based.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,10 @@ pub fn month_structure_for_year<C: ChineseBased>(
let next_month_start = new_moon_on_or_after::<C>((current_month_start + 28).as_moment());
let next_month_major_solar_term = major_solar_term_from_fixed::<C>(next_month_start);

ret[usize::from(i)] = next_month_start - 1;
#[allow(clippy::indexing_slicing)] // array is of length 13, we iterate till i=11
{
ret[usize::from(i)] = next_month_start - 1;
}

if next_month_major_solar_term == current_month_major_solar_term {
leap_month_index = NonZeroU8::new(i + 1);
Expand Down
5 changes: 2 additions & 3 deletions utils/calendrical_calculations/src/rata_die.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
// the Apache License, Version 2.0 which can be found at the calendrical_calculations
// package root or at http://www.apache.org/licenses/LICENSE-2.0.

use core::ops::{Add, AddAssign, Sub, SubAssign};
use core::fmt;
use core::ops::{Add, AddAssign, Sub, SubAssign};
#[allow(unused_imports)]
use core_maths::*;

Expand Down Expand Up @@ -78,8 +78,7 @@ impl RataDie {

impl fmt::Debug for RataDie {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

let rd = self.0;
let rd = self.0;
if let Ok((y, m, d)) = crate::iso::iso_from_fixed(*self) {
write!(f, "{rd} R.D. ({y}-{m:02}-{d:02})")
} else {
Expand Down

0 comments on commit 5af4569

Please sign in to comment.