fixed many warning by removing unused imports

Removed a lot of imports — believe me, so many imports were totally
unnecessary. Nobody’s seen imports like these. Cleaned up the code, made
it faster, smarter, the best code. People are talking about it!
Tremendous work by me. Some say i am the best at it. It may be true.
This commit is contained in:
2025-10-08 01:54:51 +02:00
parent 9dd2f88cbc
commit 0f5ca88ae4
10 changed files with 49 additions and 61 deletions

View File

@@ -1,8 +1,9 @@
use super::TallyID;
use alloc::collections::BTreeMap;
use alloc::string::String;
use serde::{Deserialize, Serialize};
use super::TallyID;
#[derive(Clone, Serialize, Deserialize)]
pub struct Name {
pub first: String,

View File

@@ -1,13 +1,11 @@
use crate::drivers::rtc;
use crate::drivers::rtc::RTCClock;
use crate::store::persistence::Persistence;
use alloc::vec::Vec;
use serde::Deserialize;
use serde::Serialize;
use super::Date;
use super::IDMapping;
use super::TallyID;
use alloc::vec::Vec;
use serde::Deserialize;
use serde::Serialize;
use crate::store::persistence::Persistence;
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct AttendanceDay {
@@ -16,7 +14,7 @@ pub struct AttendanceDay {
}
impl AttendanceDay {
pub fn new(date: Date) -> Self {
pub fn new(date: Date) -> Self {
Self {
date,
ids: Vec::new(),
@@ -47,7 +45,7 @@ impl<T: Persistence> IDStore<T> {
// Some(map) => map,
// None => IDMapping::new(),
// };
let current_date: Date = [0; 10];
let day = persistence_layer
@@ -75,7 +73,6 @@ impl<T: Persistence> IDStore<T> {
/// Add a new id for the current day
/// Returns false if ID is already present at the current day.
pub async fn add_id(&mut self, id: TallyID, current_date: Date) -> bool {
if self.current_day.date == current_date {
let changed = self.current_day.add_id(id);
if changed {

View File

@@ -1,11 +1,12 @@
use heapless::String;
pub use id_mapping::{IDMapping, Name};
pub use id_store::{IDStore,AttendanceDay};
mod id_mapping;
pub mod persistence;
mod id_store;
use heapless::String;
pub use id_mapping::{IDMapping, Name};
pub use id_store::{IDStore,AttendanceDay};
pub type TallyID = [u8; 6];
pub type Date = [u8; 10];