Skip to content

Commit

Permalink
Use trait for File in fp_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ChocolateLoverRaj committed Jun 12, 2024
1 parent 311b3b0 commit a64baa9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crosec/src/commands/fp_mode.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::os::fd::AsRawFd;

use bytemuck::{Pod, Zeroable};
use std::{fs::File, os::fd::AsRawFd};
use strum::IntoEnumIterator;
use strum_macros::{EnumIter, EnumString, IntoStaticStr};

Expand Down Expand Up @@ -51,7 +52,7 @@ struct EcResponseFpMode {
mode: u32,
}

pub fn fp_mode(file: &mut File, mode: u32) -> EcCmdResult<u32> {
pub fn fp_mode<File: AsRawFd>(file: &mut File, mode: u32) -> EcCmdResult<u32> {
let response: EcResponseFpMode = ec_command_bytemuck(
CrosEcCmd::FpMode,
0,
Expand Down

0 comments on commit a64baa9

Please sign in to comment.