Run clippy fixes

This commit is contained in:
2025-02-14 12:00:05 +01:00
parent 8b7d2ad3f7
commit 1e2247abe2
6 changed files with 30 additions and 38 deletions

View File

@@ -1,7 +1,7 @@
use std::collections::HashMap;
use axum::{
extract::{FromRef, State},
extract::State,
http::HeaderMap,
Json,
};
@@ -137,19 +137,12 @@ pub struct MigrationResponse {
remove: Vec<(String, Name)>,
}
#[derive(Default)]
pub struct MigrationStore {
pub store: HashMap<u32, MembersDiff>,
pub count: u32,
}
impl Default for MigrationStore {
fn default() -> Self {
Self {
count: 0,
store: HashMap::new(),
}
}
}
impl Row {
fn from_csv_many(input: &str) -> Result<Vec<Self>, csv::Error> {
@@ -181,25 +174,25 @@ impl Row {
}
}
impl Into<Name> for Row {
fn into(self) -> Name {
impl From<Row> for Name {
fn from(val: Row) -> Self {
Name {
first: self.first_name,
first: val.first_name,
full: "Temporarely full name".to_string(),
}
}
}
impl Into<Member> for Row {
fn into(self) -> Member {
let name: Name = self.clone().into();
impl From<Row> for Member {
fn from(val: Row) -> Self {
let name: Name = val.clone().into();
Member {
id: self.id.clone(),
id: val.id.clone(),
name,
registration_token: None,
diploma: self.diploma.clone(),
groups: self.groups_parsed(),
diploma: val.diploma.clone(),
groups: val.groups_parsed(),
roles: Roles::MEMBER,
}
}