Skip to content

Commit

Permalink
GH-37 Elevate all warnings to errors in CI of clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
svenrademakers committed Jul 4, 2023
1 parent 2662f56 commit 928c214
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/cargo_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
sudo apt-get install libusb-1.0-0-dev -y
- uses: actions/checkout@v3
- name: Run Clippy
run: cargo clippy --all-targets --all-features
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Cargo test
run: cargo test -- --nocapture

5 changes: 5 additions & 0 deletions src/c_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ pub extern "C" fn tpi_node_to_msd(node: c_int) {
});
}

/// # Safety
///
/// `image_path` needs to contain a valid utf-8 string. Secondly note that inside this function the
/// `image_path` is used by reference, therefore never pass it in its current form to another
/// context.
#[no_mangle]
pub unsafe extern "C" fn tpi_flash_node(node: c_int, image_path: *const c_char) -> FlashingResult {
let cstr = CStr::from_ptr(image_path);
Expand Down
2 changes: 2 additions & 0 deletions src/middleware/power_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ impl PowerController {
}

/// Reset a given node by setting the reset pin logically high for 1 second
/// Todo: currently not connected, dead_code.
#[allow(dead_code)]
pub async fn reset_node(&self, node: NodeId) -> anyhow::Result<()> {
trace!("reset node {:?}", node);
let idx = node as usize;
Expand Down

0 comments on commit 928c214

Please sign in to comment.