Skip to content

Commit 9e9662b

Browse files
committed
Fix clippy
1 parent 42c1384 commit 9e9662b

File tree

4 files changed

+29
-27
lines changed

4 files changed

+29
-27
lines changed

.github/workflows/ci.yml

+22-20
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ name: CI
22

33
on:
44
schedule:
5-
- cron: '0 0 * * 6'
5+
- cron: "0 0 * * 6"
66
push:
77
branches:
8-
- '*'
8+
- "*"
99
pull_request:
10+
branches:
11+
- "master"
1012

1113
jobs:
1214
rustfmt:
@@ -22,15 +24,15 @@ jobs:
2224

2325
steps:
2426
- name: Checkout
25-
uses: actions/checkout@v3
27+
uses: actions/checkout@v4
2628

27-
- name: 'Setup `${{ matrix.toolchain }}`'
29+
- name: "Setup `${{ matrix.toolchain }}`"
2830
uses: dtolnay/rust-toolchain@master
2931
with:
3032
toolchain: ${{ matrix.toolchain }}
3133
components: rustfmt
3234

33-
- name: 'Override `${{ matrix.toolchain }}'
35+
- name: "Override `${{ matrix.toolchain }}"
3436
run: |
3537
rustup override set ${{ matrix.toolchain }}
3638
@@ -50,11 +52,11 @@ jobs:
5052
- stable-x86_64-apple-darwin
5153
- stable-x86_64-unknown-linux-gnu
5254
include:
53-
- { toolchain: 1.70.0-x86_64-pc-windows-msvc , os: windows-2019 }
54-
- { toolchain: 1.70.0-x86_64-apple-darwin , os: macos-11 }
55+
- { toolchain: 1.70.0-x86_64-pc-windows-msvc, os: windows-2019 }
56+
- { toolchain: 1.70.0-x86_64-apple-darwin, os: macos-11 }
5557
- { toolchain: 1.70.0-x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
56-
- { toolchain: stable-x86_64-pc-windows-msvc , os: windows-2019 }
57-
- { toolchain: stable-x86_64-apple-darwin , os: macos-11 }
58+
- { toolchain: stable-x86_64-pc-windows-msvc, os: windows-2019 }
59+
- { toolchain: stable-x86_64-apple-darwin, os: macos-11 }
5860
- { toolchain: stable-x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
5961

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

6870
- name: Checkout
69-
uses: actions/checkout@v3
71+
uses: actions/checkout@v4
7072

71-
- name: 'Setup `${{ matrix.toolchain }}`'
73+
- name: "Setup `${{ matrix.toolchain }}`"
7274
uses: dtolnay/rust-toolchain@master
7375
with:
7476
toolchain: ${{ matrix.toolchain }}
7577
components: clippy
7678

77-
- name: 'Override `${{ matrix.toolchain }}`'
79+
- name: "Override `${{ matrix.toolchain }}`"
7880
run: |
7981
rustup override set ${{ matrix.toolchain }}
8082
@@ -100,23 +102,23 @@ jobs:
100102
- 1.70.0-x86_64-unknown-linux-gnu
101103
- stable-x86_64-unknown-linux-gnu
102104
python-version:
103-
- '3.6' # https://packages.ubuntu.com/bionic/python3
104-
- '3.8' # https://packages.ubuntu.com/focal/python3
105+
- "3.6" # https://packages.ubuntu.com/bionic/python3
106+
- "3.8" # https://packages.ubuntu.com/focal/python3
105107

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

109111
steps:
110112
- name: Checkout
111-
uses: actions/checkout@v3
113+
uses: actions/checkout@v4
112114

113-
- name: 'Setup `${{ matrix.toolchain }}`'
115+
- name: "Setup `${{ matrix.toolchain }}`"
114116
uses: dtolnay/rust-toolchain@master
115117
with:
116118
toolchain: ${{ matrix.toolchain }}
117119
components: rustfmt
118120

119-
- name: 'Override `${{ matrix.toolchain }}`'
121+
- name: "Override `${{ matrix.toolchain }}`"
120122
run: |
121123
rustup override set ${{ matrix.toolchain }}
122124
@@ -134,21 +136,21 @@ jobs:
134136

135137
steps:
136138
- name: Checkout
137-
uses: actions/checkout@v3
139+
uses: actions/checkout@v4
138140

139141
- name: Setup `1.70.0-x86_64-unknown-linux-gnu`
140142
uses: dtolnay/rust-toolchain@master
141143
with:
142144
toolchain: 1.70.0-x86_64-unknown-linux-gnu
143145

144-
- name: 'Override `1.70.0-x86_64-unknown-linux-gnu'
146+
- name: "Override `1.70.0-x86_64-unknown-linux-gnu"
145147
run: |
146148
rustup override set 1.70.0-x86_64-unknown-linux-gnu
147149
148150
- name: Setup Python 3.9
149151
uses: actions/setup-python@v4
150152
with:
151-
python-version: '3.9'
153+
python-version: "3.9"
152154

153155
- name: Install `oj`
154156
run: pip install online-judge-tools

src/internal_math.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ pub(crate) struct Barrett {
2727
impl Barrett {
2828
/// # Arguments
2929
/// * `m` `1 <= m`
30-
/// (Note: `m <= 2^31` should also hold, which is undocumented in the original library.
31-
/// See the [pull reqeust commment](https://github.com/rust-lang-ja/ac-library-rs/pull/3#discussion_r484661007)
32-
/// for more details.)
30+
/// (Note: `m <= 2^31` should also hold, which is undocumented in the original library.
31+
/// See the [pull reqeust commment](https://github.com/rust-lang-ja/ac-library-rs/pull/3#discussion_r484661007)
32+
/// for more details.)
3333
pub(crate) fn new(m: u32) -> Barrett {
3434
Barrett {
3535
_m: m,
@@ -208,7 +208,7 @@ pub(crate) fn primitive_root(m: i32) -> i32 {
208208
while x % 2 == 0 {
209209
x /= 2;
210210
}
211-
for i in (3..std::i32::MAX).step_by(2) {
211+
for i in (3..i32::MAX).step_by(2) {
212212
if i as i64 * i as i64 > x as i64 {
213213
break;
214214
}

src/internal_type_traits.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ macro_rules! impl_integral {
9999
impl BoundedBelow for $ty {
100100
#[inline]
101101
fn min_value() -> Self {
102-
Self::min_value()
102+
Self::MIN
103103
}
104104
}
105105

106106
impl BoundedAbove for $ty {
107107
#[inline]
108108
fn max_value() -> Self {
109-
Self::max_value()
109+
Self::MAX
110110
}
111111
}
112112

src/modint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ macro_rules! impl_basic_traits {
858858
}
859859
}
860860

861-
#[allow(clippy::derive_hash_xor_eq)]
861+
#[allow(clippy::derived_hash_with_manual_eq)]
862862
impl<$generic_param: $generic_param_bound> Hash for $self {
863863
#[inline]
864864
fn hash<H: Hasher>(&self, state: &mut H) {

0 commit comments

Comments
 (0)