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
10 changes: 5 additions & 5 deletions src/app/fprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ pub async fn clear_all_fingers_dbus(

pub async fn enroll_fingerprint_process<S>(
connection: zbus::Connection,
path: zbus::zvariant::OwnedObjectPath,
finger_name: String,
username: String,
path: &zbus::zvariant::OwnedObjectPath,
finger_name: &str,
username: &str,
output: &mut S,
) -> zbus::Result<()>
where
Expand All @@ -107,7 +107,7 @@ where
.await?;

// Claim device
match device.claim(&username).await {
match device.claim(username).await {
Ok(_) => {}
Err(e) => return Err(e),
};
Expand All @@ -119,7 +119,7 @@ where
let _ = output.send(Message::EnrollStart(total_stages)).await;

// Start enrollment
if let Err(e) = device.enroll_start(&finger_name).await {
if let Err(e) = device.enroll_start(finger_name).await {
let _ = device.release().await;
return Err(e);
}
Expand Down
9 changes: 3 additions & 6 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,11 @@ impl cosmic::Application for AppModel {
std::any::TypeId::of::<EnrollmentSubscription>(),
cosmic::iced::stream::channel(100, move |mut output| async move {
// Implement enrollment stream here
let username = (*user.username).clone();
let device_path = (*device_path).clone();
let finger_name = (*finger_name).clone();
match enroll_fingerprint_process(
connection,
device_path,
finger_name,
username,
&device_path,
&finger_name,
&user.username,
&mut output,
)
.await
Expand Down
Loading