Skip to content

Commit f499ce2

Browse files
committed
fix: Resolve Rust CI workflow issues
- Remove unused PixelFormat import in capture_grab.rs - Simplify device_index selection logic in capture_callback.rs - Remove unnecessary type cast (device_index as i32) - Add cache: false to Rust toolchain setup to avoid Cargo.toml lookup errors Fixes clippy warnings: - unused-imports - if-same-then-else - unnecessary-cast
1 parent e049718 commit f499ce2

3 files changed

Lines changed: 5 additions & 9 deletions

File tree

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
with:
5858
toolchain: stable
5959
components: clippy, rustfmt
60+
cache: false
6061

6162
# Build C++ Library (Linux/macOS)
6263
# We build in build/Debug to match build.rs expectations for Unix Makefiles
@@ -121,8 +122,7 @@ jobs:
121122
uses: actions-rust-lang/setup-rust-toolchain@v1
122123
with:
123124
toolchain: stable
124-
125-
# Note: We intentionally DO NOT build the C++ library manually here.
125+
cache: false
126126
# The build.rs script should handle it via the 'build-source' feature.
127127

128128
- name: Build Rust bindings (Source)

bindings/rust/examples/capture_callback.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ fn main() -> Result<()> {
2727
}
2828

2929
// Select camera device (automatically use first device for testing)
30-
let device_index = if devices.len() == 1 {
31-
0
32-
} else {
33-
0 // Just use first device for now
34-
};
30+
let device_index = 0;
3531

3632
// Create provider with selected device
37-
let mut provider = Provider::with_device(device_index as i32)?;
33+
let mut provider = Provider::with_device(device_index)?;
3834

3935
// Set camera properties
4036
let requested_width = 1920;

bindings/rust/examples/capture_grab.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use ccap::{LogLevel, PixelFormat, PropertyName, Provider, Result, Utils};
1+
use ccap::{LogLevel, PropertyName, Provider, Result, Utils};
22
use std::fs;
33

44
fn main() -> Result<()> {

0 commit comments

Comments
 (0)