-
-
Notifications
You must be signed in to change notification settings - Fork 10
Update dependencies, cargo clippy, increase test coverage #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the codebase to use Rust’s named format arguments (introduced in Rust 1.58) and bumps the tungstenite and tokio-tungstenite dependencies to version 0.27.0, adjusting related APIs and formatting calls accordingly.
- Migrate
format!("…{}", var)andprintln!("{}", var)to named format capture ("{var}") across the codebase. - Adapt WebSocket calls from
write_message/read_messagetosend/readfor the newtungsteniteversion. - Update MD5 API calls from
compute()tofinalize()and bump dependency versions inCargo.toml.
Reviewed Changes
Copilot reviewed 37 out of 38 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/parser/utils.rs | Converted format! calls to named captures |
| src/parser/rislive/mod.rs | Switched write_message to send and inlined named format args |
| src/parser/rislive/messages/server/raw_bytes.rs | Applied named format args |
| src/parser/rislive/error.rs | Updated write! calls to named format capture |
| src/parser/mrt/mrt_record.rs | Switched format! to named format capture |
| src/parser/mrt/messages/table_dump_v2/... | Applied named format args |
| src/parser/parser/mod.rs | Converted string concatenation to named format capture |
| src/parser/filter.rs | Migrated all format! calls to named captures |
| src/parser/bmp/... | Updated panic!/println! macros and named format usage |
| src/parser/bgp/... | Updated format! calls to named captures |
| src/models/... | Converted display tests to use named captures |
| src/lib.rs | WebSocket send changes and named format usage |
| examples/... | Adjusted WebSocket calls and print macros for named captures |
| benches/data_source.rs | Replaced compute() with finalize() and updated hex formatting |
| Cargo.toml | Bumped tungstenite/tokio-tungstenite to 0.27.0 |
Comments suppressed due to low confidence (6)
src/parser/rislive/mod.rs:27
- [nitpick] The
into()call is redundant here sincemsgis already aString. You can pass it directly asMessage::Text(msg)to simplify the code.
socket.send(Message::Text(msg.into())).unwrap();
examples/real-time-ris-live-websocket.rs:18
- [nitpick] Calling
into()on the result ofto_json_string()is unnecessary because it already returns aString. You can write.send(Message::Text(msg.to_json_string()))directly.
.send(Message::Text(msg.to_json_string().into()))
examples/real-time-ris-live-websocket-async.rs:18
- [nitpick] The
into()call is redundant on aStringhere; you can simplify this to.send(Message::Text(msg.to_json_string())).
.send(Message::Text(msg.to_json_string().into()))
src/lib.rs:150
- [nitpick] Since
msgis already aString, the.into()call is superfluous. You can passmsgdirectly:Message::Text(msg).
socket.send(Message::Text(msg.into())).unwrap();
benches/data_source.rs:65
- [nitpick] Comparing a temporary
String’s&strvia.as_str()is unnecessary; you can directly compare theStringand&strwith==, e.g.,if format!("{computed_checksum:x}") == checksum.
if format!("{computed_checksum:x}").as_str() == checksum {
benches/data_source.rs:78
- [nitpick] You can simplify the comparison by omitting
.as_str()and lettingStringcompare directly to&str:if format!("{download_checksum:x}") != checksum.
if format!("{download_checksum:x}").as_str() != checksum {
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #220 +/- ##
==========================================
+ Coverage 93.36% 93.71% +0.35%
==========================================
Files 67 67
Lines 7461 7625 +164
==========================================
+ Hits 6966 7146 +180
+ Misses 495 479 -16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
remove two unnecessary allow lints:
- `needless_range_loop`
- `new_without_default`
add a new allow lint:
- `uninlined_format_args`: to allow `println!("{}", arg);`
No description provided.