Skip to content

Commit cc4cbea

Browse files
Add CI (#1)
* save * save * save
1 parent 8091e32 commit cc4cbea

3 files changed

Lines changed: 50 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout sources
18+
uses: actions/checkout@v4
19+
20+
- name: Install Rust toolchain
21+
uses: dtolnay/rust-toolchain@stable
22+
23+
- name: Run cargo test
24+
run: cargo test
25+
26+
27+
lints:
28+
name: Lints
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout sources
32+
uses: actions/checkout@v4
33+
34+
- name: Install Rust toolchain
35+
uses: dtolnay/rust-toolchain@stable
36+
with:
37+
components: rustfmt, clippy
38+
39+
- name: Run cargo fmt
40+
run: cargo fmt --all -- --check
41+
42+
- name: Run cargo clippy
43+
run: cargo clippy -- -D warnings

.github/workflows/release-plz.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release-plz
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77

88
jobs:
99
release-plz-release:

src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async fn main() -> Result<()> {
104104

105105
if args.verbosity > 0 {
106106
info!("webtranscat starting");
107-
debug!("Arguments: {:?}", args);
107+
debug!("Arguments: {args:?}");
108108
}
109109

110110
// Create client and connect
@@ -138,7 +138,7 @@ async fn main() -> Result<()> {
138138
}
139139
}
140140
Err(e) => {
141-
error!("Datagram error: {}", e);
141+
error!("Datagram error: {e}");
142142
break;
143143
}
144144
}
@@ -174,12 +174,12 @@ async fn main() -> Result<()> {
174174
}
175175
}
176176
Err(e) => {
177-
error!("Stream read error: {}", e);
177+
error!("Stream read error: {e}");
178178
}
179179
}
180180
}
181181
Err(e) => {
182-
error!("Stream accept error: {}", e);
182+
error!("Stream accept error: {e}");
183183
break;
184184
}
185185
}
@@ -214,13 +214,13 @@ async fn main() -> Result<()> {
214214
}
215215

216216
if let Err(e) = session.send_datagram(Bytes::from(data.to_vec())) {
217-
error!("Failed to send datagram: {}", e);
217+
error!("Failed to send datagram: {e}");
218218
} else if verbose {
219219
debug!("Datagram sent successfully");
220220
}
221221
}
222222
Err(e) => {
223-
error!("Error reading from stdin: {}", e);
223+
error!("Error reading from stdin: {e}");
224224
break;
225225
}
226226
}

0 commit comments

Comments
 (0)