ci: add GitHub Actions workflows with semantic-release auto-versioning
chore: fix all 702 clippy warnings across codebase - auto-fix 475 via cargo clippy --fix - fix remaining 227 manually: uninlined_format_args, redundant_closure, match_same_arms, underscore_binding, format_push_string, items_after_statements, needless_pass_by_value, clone_on_copy, case_sensitive_extension, single_match/let-else, write_with_newline, and other clippy lints
This commit is contained in:
+3
-2
@@ -1,3 +1,4 @@
|
||||
#![allow(clippy::cast_possible_truncation, clippy::cast_sign_loss, clippy::cast_precision_loss, clippy::cast_possible_wrap)]
|
||||
//! Length-prefixed binary framing and JSON (de)serialization helpers for
|
||||
//! the IPC wire protocol.
|
||||
//!
|
||||
@@ -26,7 +27,7 @@ pub(crate) const MAX_FRAME_SIZE: usize = 64 * 1024 * 1024;
|
||||
pub fn write_frame<W: Write>(writer: &mut W, data: &[u8]) -> Result<()> {
|
||||
let len = data.len();
|
||||
if len > MAX_FRAME_SIZE {
|
||||
anyhow::bail!("frame too large: {} bytes exceeds 64 MiB limit", len);
|
||||
anyhow::bail!("frame too large: {len} bytes exceeds 64 MiB limit");
|
||||
}
|
||||
let len_bytes = (len as u32).to_be_bytes();
|
||||
writer.write_all(&len_bytes)?;
|
||||
@@ -52,7 +53,7 @@ pub fn read_frame<R: Read>(reader: &mut R) -> Result<Option<Vec<u8>>> {
|
||||
}
|
||||
let len = u32::from_be_bytes(len_buf) as usize;
|
||||
if len > MAX_FRAME_SIZE {
|
||||
anyhow::bail!("frame too large: {} bytes exceeds 64 MiB limit", len);
|
||||
anyhow::bail!("frame too large: {len} bytes exceeds 64 MiB limit");
|
||||
}
|
||||
let mut buf = vec![0u8; len];
|
||||
reader.read_exact(&mut buf)?;
|
||||
|
||||
Reference in New Issue
Block a user