Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bin/camera_test.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/// camera-test — capture a frame from the IR camera and save it as PNG
/// Usage: cargo run --bin camera-test [/dev/video2] [output.png]
//! camera-test — capture a frame from the IR camera and save it as PNG
//! Usage: cargo run --bin camera-test [/dev/video2] [output.png]

fn main() {
eprintln!("[camera-test] Starting...");

let device_path = std::env::args()
.nth(1)
.unwrap_or_else(|| pam_rustface::camera::auto_detect_ir_camera());
.unwrap_or_else(pam_rustface::camera::auto_detect_ir_camera);
let output_path = std::env::args()
.nth(2)
.unwrap_or_else(|| "frame.png".to_owned());
Expand Down
2 changes: 1 addition & 1 deletion src/bin/enroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn main() {
// Open camera — auto-detect IR camera if not specified
let device = std::env::args()
.nth(3)
.unwrap_or_else(|| pam_rustface::camera::auto_detect_ir_camera());
.unwrap_or_else(pam_rustface::camera::auto_detect_ir_camera);
eprintln!("[enroll] Camera: {device}");
let camera = IrCamera::open(&device).unwrap_or_else(|e| {
eprintln!("[enroll] ERROR opening camera: {e}");
Expand Down
2 changes: 1 addition & 1 deletion src/bin/sim_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn main() {

let device = std::env::args()
.nth(2)
.unwrap_or_else(|| pam_rustface::camera::auto_detect_ir_camera());
.unwrap_or_else(pam_rustface::camera::auto_detect_ir_camera);
eprintln!("[sim-test] Camera: {device}");
let camera = IrCamera::open(&device).expect("Failed to open camera");

Expand Down
1 change: 0 additions & 1 deletion src/pam/constants.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::os::raw::c_int;

pub const PAM_SUCCESS: c_int = 0;
pub const PAM_AUTH_ERR: c_int = 7;
pub const PAM_IGNORE: c_int = 25;
pub const PAM_USER: c_int = 2;
3 changes: 0 additions & 3 deletions src/pam/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
pub mod constants;
pub mod handle;

pub use constants::{PAM_AUTH_ERR, PAM_IGNORE, PAM_SUCCESS};
pub use handle::{get_username, PamHandle};
10 changes: 6 additions & 4 deletions src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ impl FaceStore {
}
}

pub fn default() -> Self {
Self::new(FACES_DIR)
}

fn user_path(&self, username: &str) -> PathBuf {
self.base_path.join(format!("{username}.bin"))
}
Expand All @@ -47,3 +43,9 @@ impl FaceStore {
write::write_embedding(&path, embedding)
}
}

impl Default for FaceStore {
fn default() -> Self {
Self::new(FACES_DIR)
}
}
Loading