Skip to content

Commit 686372b

Browse files
Merge branch 'master' into range-bounds
2 parents 293713a + 6b867d6 commit 686372b

14 files changed

+77
-184
lines changed

.github/workflows/ci.yml

+44-46
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ jobs:
1818
- stable-x86_64-unknown-linux-gnu
1919

2020
name: Rustfmt (${{ matrix.toolchain }})
21-
runs-on: ubuntu-18.04
21+
runs-on: ubuntu-20.04
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
2626

2727
- name: 'Setup `${{ matrix.toolchain }}`'
28-
uses: actions-rs/toolchain@v1
28+
uses: dtolnay/rust-toolchain@master
2929
with:
3030
toolchain: ${{ matrix.toolchain }}
31-
override: true
32-
profile: minimal
3331
components: rustfmt
3432

33+
- name: 'Override `${{ matrix.toolchain }}'
34+
run: |
35+
rustup override set ${{ matrix.toolchain }}
36+
3537
- name: cargo-fmt
36-
uses: actions-rs/cargo@v1
37-
with:
38-
command: fmt
39-
args: --all -- --check
38+
run: |
39+
cargo fmt --all -- --check
4040
4141
build:
4242
strategy:
@@ -51,11 +51,11 @@ jobs:
5151
- stable-x86_64-unknown-linux-gnu
5252
include:
5353
- { toolchain: 1.42.0-x86_64-pc-windows-msvc , os: windows-2019 }
54-
- { toolchain: 1.42.0-x86_64-apple-darwin , os: macos-10.15 }
55-
- { toolchain: 1.42.0-x86_64-unknown-linux-gnu, os: ubuntu-18.04 }
54+
- { toolchain: 1.42.0-x86_64-apple-darwin , os: macos-11 }
55+
- { toolchain: 1.42.0-x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
5656
- { toolchain: stable-x86_64-pc-windows-msvc , os: windows-2019 }
57-
- { toolchain: stable-x86_64-apple-darwin , os: macos-10.15 }
58-
- { toolchain: stable-x86_64-unknown-linux-gnu, os: ubuntu-18.04 }
57+
- { toolchain: stable-x86_64-apple-darwin , os: macos-11 }
58+
- { toolchain: stable-x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
5959

6060
name: Build (${{ matrix.toolchain }})
6161
runs-on: ${{ matrix.os }}
@@ -66,33 +66,29 @@ jobs:
6666
if: matrix.os == 'windows-2019'
6767

6868
- name: Checkout
69-
uses: actions/checkout@v2
69+
uses: actions/checkout@v3
7070

7171
- name: 'Setup `${{ matrix.toolchain }}`'
72-
uses: actions-rs/toolchain@v1
72+
uses: dtolnay/rust-toolchain@master
7373
with:
7474
toolchain: ${{ matrix.toolchain }}
75-
override: true
76-
profile: minimal
7775
components: clippy
7876

77+
- name: 'Override `${{ matrix.toolchain }}`'
78+
run: |
79+
rustup override set ${{ matrix.toolchain }}
80+
7981
- name: cargo-clippy
80-
uses: actions-rs/cargo@v1
81-
with:
82-
command: clippy
83-
args: --workspace --all-targets -- -D warnings
82+
run: |
83+
cargo clippy --workspace --all-targets -- -A renamed-and-removed-lints -D warnings
8484
8585
- name: cargo-build
86-
uses: actions-rs/cargo@v1
87-
with:
88-
command: build
89-
args: --workspace --all-targets
86+
run: |
87+
cargo build --workspace --all-targets
9088
9189
- name: cargo-test
92-
uses: actions-rs/cargo@v1
93-
with:
94-
command: test
95-
args: --workspace --no-fail-fast
90+
run: |
91+
cargo test --workspace --no-fail-fast
9692
env:
9793
RUST_BACKTRACE: full
9894

@@ -108,22 +104,24 @@ jobs:
108104
- '3.8' # https://packages.ubuntu.com/focal/python3
109105

110106
name: Expand_test (${{ matrix.toolchain }}, ${{ matrix.python-version }})
111-
runs-on: ubuntu-18.04
107+
runs-on: ubuntu-20.04
112108

113109
steps:
114110
- name: Checkout
115-
uses: actions/checkout@v2
111+
uses: actions/checkout@v3
116112

117113
- name: 'Setup `${{ matrix.toolchain }}`'
118-
uses: actions-rs/toolchain@v1
114+
uses: dtolnay/rust-toolchain@master
119115
with:
120116
toolchain: ${{ matrix.toolchain }}
121-
override: true
122-
profile: minimal
123117
components: rustfmt
124118

119+
- name: 'Override `${{ matrix.toolchain }}`'
120+
run: |
121+
rustup override set ${{ matrix.toolchain }}
122+
125123
- name: Setup Python ${{ matrix.python-version }}
126-
uses: actions/setup-python@v2
124+
uses: actions/setup-python@v4
127125
with:
128126
python-version: ${{ matrix.python-version }}
129127

@@ -136,28 +134,28 @@ jobs:
136134

137135
steps:
138136
- name: Checkout
139-
uses: actions/checkout@v2
137+
uses: actions/checkout@v3
140138

141-
- name: Setup `1.47.0-x86_64-unknown-linux-gnu`
142-
uses: actions-rs/toolchain@v1
139+
- name: Setup `1.60.0-x86_64-unknown-linux-gnu`
140+
uses: dtolnay/rust-toolchain@master
143141
with:
144-
toolchain: 1.47.0-x86_64-unknown-linux-gnu
145-
override: true
146-
profile: minimal
142+
toolchain: 1.60.0-x86_64-unknown-linux-gnu
143+
144+
- name: 'Override `1.60.0-x86_64-unknown-linux-gnu'
145+
run: |
146+
rustup override set 1.60.0-x86_64-unknown-linux-gnu
147147
148148
- name: Setup Python 3.9
149-
uses: actions/setup-python@v2
149+
uses: actions/setup-python@v4
150150
with:
151151
python-version: '3.9'
152152

153153
- name: Install `oj`
154154
run: pip install online-judge-tools
155155

156156
- name: cargo-build
157-
uses: actions-rs/cargo@v1
158-
with:
159-
command: build
160-
args: --release --examples
157+
run: |
158+
cargo build --release --examples
161159
162160
- name: Verify
163161
run: |

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ publish = false
1515
[dependencies]
1616

1717
[dev-dependencies]
18-
input = { path = "./crates/input" }
1918
proconio = "=0.3.6"
2019
proconio-derive = "0.2.1"
2120
rand = "0.7.3"

crates/input/Cargo.toml

-10
This file was deleted.

crates/input/src/lib.rs

-96
This file was deleted.

doc/katex-header.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
2-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
3-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"></script>
1+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.css" integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0" crossorigin="anonymous">
2+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.js" integrity="sha384-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amXcgMg5457rve2Y7I6ZJSm2A0mS4" crossorigin="anonymous"></script>
3+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"></script>
44
<script>
55
document.addEventListener("DOMContentLoaded", () => {
66
renderMathInElement(document.body, {

examples/library-checker-convolution-mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[macro_use]
2-
extern crate input as _;
2+
extern crate proconio as _;
33

44
use ac_library_rs::{convolution, modint::ModInt998244353 as Mint};
55
use std::fmt;

examples/library-checker-static-range-sum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[macro_use]
2-
extern crate input as _;
2+
extern crate proconio as _;
33
#[macro_use]
44
extern crate proconio_derive as _;
55

examples/library-checker-sum-of-floor-of-linear.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[macro_use]
2-
extern crate input as _;
2+
extern crate proconio as _;
33
#[macro_use]
44
extern crate proconio_derive as _;
55

examples/library-checker-unionfind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[macro_use]
2-
extern crate input as _;
2+
extern crate proconio as _;
33

44
use ac_library_rs::dsu::Dsu;
55

expand.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
Options:
2727
-a --all import all modules
2828
-h --help print help
29+
-o file
30+
--output file output file
2931
'''
3032
output_header = '//https://github.com/rust-lang-ja/ac-library-rs\n'
31-
opt_list = ['help', 'all']
33+
opt_list = ['help', 'all', 'output=']
3234
output_list_all = ('convolution', 'dsu', 'fenwicktree', 'lazysegtree', 'math',
3335
'maxflow', 'mincostflow', 'modint', 'scc', 'segtree',
3436
'string', 'twosat',
@@ -44,13 +46,14 @@
4446
'segtree': ('internal_bit', 'internal_type_traits',),
4547
'twosat': ('internal_scc',), }
4648
src_path = 'src/'
49+
output_path = None
4750

4851

4952
def output_file(filename):
5053
global src_path
5154

5255
res = []
53-
with open(src_path+filename+'.rs', 'r') as f:
56+
with open(src_path+filename+'.rs', 'r', encoding='utf-8', newline='') as f:
5457
res.append('pub mod {} {{'.format(filename))
5558

5659
for line in f:
@@ -61,7 +64,7 @@ def output_file(filename):
6164

6265

6366
try:
64-
opts, args = getopt.getopt(sys.argv[1:], 'ah', opt_list)
67+
opts, args = getopt.getopt(sys.argv[1:], 'aho:', opt_list)
6568
except getopt.GetoptError as e:
6669
print(e)
6770
print(usage)
@@ -77,6 +80,8 @@ def output_file(filename):
7780
sys.exit(0)
7881
elif o == '--all' or o == '-a':
7982
args = list(output_list_all)
83+
elif o == '--output' or o == '-o':
84+
output_path = v
8085

8186
output_list = set()
8287

@@ -108,11 +113,14 @@ def output_file(filename):
108113
# rustfmt
109114
with tempfile.TemporaryDirectory() as temp_dir:
110115
temp_file = temp_dir + '/output.rs'
111-
with open(temp_file, 'w') as f:
116+
with open(temp_file, 'w', encoding='utf-8', newline='') as f:
112117
print(output_header, file=f)
113118
for i in output_data:
114119
print(i, file=f)
115120
output_data = subprocess.run(["rustfmt", temp_file], check=True)
116-
with open(temp_file, 'r') as f:
121+
with open(temp_file, 'r', encoding='utf-8', newline='') as f:
122+
wf = open(output_path, 'w', encoding='utf-8', newline='') if output_path is not None else sys.stdout
117123
for line in f:
118-
print(line, end="")
124+
print(line, end='', file=wf)
125+
if output_path is not None:
126+
wf.close()

0 commit comments

Comments
 (0)