Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
koba-e964 committed Feb 19, 2025
1 parent 42c1384 commit 9e9662b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 27 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: CI

on:
schedule:
- cron: '0 0 * * 6'
- cron: "0 0 * * 6"
push:
branches:
- '*'
- "*"
pull_request:
branches:
- "master"

jobs:
rustfmt:
Expand All @@ -22,15 +24,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Setup `${{ matrix.toolchain }}`'
- name: "Setup `${{ matrix.toolchain }}`"
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt

- name: 'Override `${{ matrix.toolchain }}'
- name: "Override `${{ matrix.toolchain }}"
run: |
rustup override set ${{ matrix.toolchain }}
Expand All @@ -50,11 +52,11 @@ jobs:
- stable-x86_64-apple-darwin
- stable-x86_64-unknown-linux-gnu
include:
- { toolchain: 1.70.0-x86_64-pc-windows-msvc , os: windows-2019 }
- { toolchain: 1.70.0-x86_64-apple-darwin , os: macos-11 }
- { toolchain: 1.70.0-x86_64-pc-windows-msvc, os: windows-2019 }
- { toolchain: 1.70.0-x86_64-apple-darwin, os: macos-11 }
- { toolchain: 1.70.0-x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
- { toolchain: stable-x86_64-pc-windows-msvc , os: windows-2019 }
- { toolchain: stable-x86_64-apple-darwin , os: macos-11 }
- { toolchain: stable-x86_64-pc-windows-msvc, os: windows-2019 }
- { toolchain: stable-x86_64-apple-darwin, os: macos-11 }
- { toolchain: stable-x86_64-unknown-linux-gnu, os: ubuntu-20.04 }

name: Build (${{ matrix.toolchain }})
Expand All @@ -66,15 +68,15 @@ jobs:
if: matrix.os == 'windows-2019'

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Setup `${{ matrix.toolchain }}`'
- name: "Setup `${{ matrix.toolchain }}`"
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy

- name: 'Override `${{ matrix.toolchain }}`'
- name: "Override `${{ matrix.toolchain }}`"
run: |
rustup override set ${{ matrix.toolchain }}
Expand All @@ -100,23 +102,23 @@ jobs:
- 1.70.0-x86_64-unknown-linux-gnu
- stable-x86_64-unknown-linux-gnu
python-version:
- '3.6' # https://packages.ubuntu.com/bionic/python3
- '3.8' # https://packages.ubuntu.com/focal/python3
- "3.6" # https://packages.ubuntu.com/bionic/python3
- "3.8" # https://packages.ubuntu.com/focal/python3

name: Expand_test (${{ matrix.toolchain }}, ${{ matrix.python-version }})
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Setup `${{ matrix.toolchain }}`'
- name: "Setup `${{ matrix.toolchain }}`"
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt

- name: 'Override `${{ matrix.toolchain }}`'
- name: "Override `${{ matrix.toolchain }}`"
run: |
rustup override set ${{ matrix.toolchain }}
Expand All @@ -134,21 +136,21 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup `1.70.0-x86_64-unknown-linux-gnu`
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.70.0-x86_64-unknown-linux-gnu

- name: 'Override `1.70.0-x86_64-unknown-linux-gnu'
- name: "Override `1.70.0-x86_64-unknown-linux-gnu"
run: |
rustup override set 1.70.0-x86_64-unknown-linux-gnu
- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: "3.9"

- name: Install `oj`
run: pip install online-judge-tools
Expand Down
8 changes: 4 additions & 4 deletions src/internal_math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ pub(crate) struct Barrett {
impl Barrett {
/// # Arguments
/// * `m` `1 <= m`
/// (Note: `m <= 2^31` should also hold, which is undocumented in the original library.
/// See the [pull reqeust commment](https://github.com/rust-lang-ja/ac-library-rs/pull/3#discussion_r484661007)
/// for more details.)
/// (Note: `m <= 2^31` should also hold, which is undocumented in the original library.
/// See the [pull reqeust commment](https://github.com/rust-lang-ja/ac-library-rs/pull/3#discussion_r484661007)
/// for more details.)
pub(crate) fn new(m: u32) -> Barrett {
Barrett {
_m: m,
Expand Down Expand Up @@ -208,7 +208,7 @@ pub(crate) fn primitive_root(m: i32) -> i32 {
while x % 2 == 0 {
x /= 2;
}
for i in (3..std::i32::MAX).step_by(2) {
for i in (3..i32::MAX).step_by(2) {
if i as i64 * i as i64 > x as i64 {
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/internal_type_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ macro_rules! impl_integral {
impl BoundedBelow for $ty {
#[inline]
fn min_value() -> Self {
Self::min_value()
Self::MIN
}
}

impl BoundedAbove for $ty {
#[inline]
fn max_value() -> Self {
Self::max_value()
Self::MAX
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/modint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ macro_rules! impl_basic_traits {
}
}

#[allow(clippy::derive_hash_xor_eq)]
#[allow(clippy::derived_hash_with_manual_eq)]
impl<$generic_param: $generic_param_bound> Hash for $self {
#[inline]
fn hash<H: Hasher>(&self, state: &mut H) {
Expand Down

0 comments on commit 9e9662b

Please sign in to comment.