Skip to content

Commit 2a7dcda

Browse files
David-Martelclaude
andcommitted
fix: update bytes 1.11.0→1.11.1 (CVE) and resolve clippy warnings
Cargo.lock: bumped bytes to 1.11.1 fixing integer overflow in BytesMut::reserve (RUSTSEC-2025-0023). Clippy fixes across 5 files: iter().any → contains, get(0) → first, len() > 0 → !is_empty, collapsible_if, const assertion blocks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bcfe940 commit 2a7dcda

6 files changed

Lines changed: 15 additions & 17 deletions

File tree

adobe-mcp-rs/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adobe-mcp-rs/acrobat-bridge/src/commands.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ fn normalize_page_numbers(value: &Value) -> Result<Vec<i64>> {
872872
return Err(anyhow::anyhow!("At least one page number required"));
873873
}
874874

875-
let treat_as_one_based = !page_nums.iter().any(|n| *n == 0);
875+
let treat_as_one_based = !page_nums.contains(&0);
876876
if treat_as_one_based {
877877
page_nums = page_nums
878878
.into_iter()
@@ -936,7 +936,7 @@ fn normalize_page_ranges(value: &Value) -> Result<Vec<Value>> {
936936
if range_array.is_empty() {
937937
continue;
938938
}
939-
let start = range_array.get(0).and_then(|v| v.as_i64()).unwrap_or(0);
939+
let start = range_array.first().and_then(|v| v.as_i64()).unwrap_or(0);
940940
let end = range_array
941941
.get(1)
942942
.and_then(|v| v.as_i64())

adobe-mcp-rs/acrobat-bridge/src/ffi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,9 @@ mod tests {
354354

355355
#[test]
356356
fn test_plugin_constants() {
357-
assert!(ACROBAT_SDK_VERSION > 0);
358-
assert!(HANDSHAKE_VERSION > 0);
359-
assert!(PLUGIN_VERSION > 0);
357+
const { assert!(ACROBAT_SDK_VERSION > 0) };
358+
const { assert!(HANDSHAKE_VERSION > 0) };
359+
const { assert!(PLUGIN_VERSION > 0) };
360360
}
361361

362362
#[test]

adobe-mcp-rs/adobe-common/tests/integration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ fn test_command_with_all_option_types() {
192192
json!({
193193
"string_opt": "hello",
194194
"number_opt": 42,
195-
"float_opt": 3.14,
195+
"float_opt": 3.15,
196196
"bool_opt": true,
197197
"null_opt": null,
198198
"array_opt": [1, 2, 3],

adobe-mcp-rs/adobe-proxy/src/main.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,9 @@ async fn handle_event(
403403
state.auto_launch_timeout,
404404
)
405405
.await
406+
&& state.send_to_application(&packet_with_sender)
406407
{
407-
if state.send_to_application(&packet_with_sender) {
408-
return;
409-
}
408+
return;
410409
}
411410

412411
auto_launch_note = Some(format!(
@@ -501,11 +500,10 @@ fn try_launch_application(application: &str) -> bool {
501500
};
502501

503502
for exe in candidates {
504-
if std::path::Path::new(exe).exists() {
505-
if Command::new(exe).spawn().is_ok() {
506-
info!("Auto-launched {} via {}", application, exe);
507-
return true;
508-
}
503+
if std::path::Path::new(exe).exists()
504+
&& Command::new(exe).spawn().is_ok() {
505+
info!("Auto-launched {} via {}", application, exe);
506+
return true;
509507
}
510508
}
511509

adobe-mcp-rs/photoshop-mcp/src/tools.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ mod tests {
266266
#[test]
267267
fn test_tool_definitions() {
268268
let tools = get_tool_definitions();
269-
assert!(tools.len() > 0);
269+
assert!(!tools.is_empty());
270270

271271
for tool in tools {
272272
assert!(tool.get("name").is_some());

0 commit comments

Comments
 (0)