Update Rust to edition 2024
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c6e53d5790
commit
ca6b5d398b
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "geneit_backend"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
use crate::app_config::AppConfig;
|
||||
use diesel::result::{DatabaseErrorKind, Error};
|
||||
use diesel::{Connection, PgConnection};
|
||||
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
|
||||
use diesel_migrations::{EmbeddedMigrations, MigrationHarness, embed_migrations};
|
||||
use std::cell::RefCell;
|
||||
|
||||
const MIGRATIONS: EmbeddedMigrations = embed_migrations!();
|
||||
|
@ -4,7 +4,7 @@ use crate::extractors::accommodation_extractor::FamilyAndAccommodationInPath;
|
||||
use crate::extractors::family_extractor::{FamilyInPath, FamilyInPathWithAdminMembership};
|
||||
use crate::models::Accommodation;
|
||||
use crate::services::accommodations_list_service;
|
||||
use actix_web::{web, HttpResponse};
|
||||
use actix_web::{HttpResponse, web};
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
enum AccommodationListControllerErr {
|
||||
|
@ -1,6 +1,6 @@
|
||||
use ical::{generator::*, *};
|
||||
|
||||
use actix_web::{web, HttpResponse};
|
||||
use actix_web::{HttpResponse, web};
|
||||
use chrono::DateTime;
|
||||
|
||||
use crate::constants::StaticConstraints;
|
||||
|
@ -5,7 +5,7 @@ use crate::extractors::family_extractor::FamilyInPath;
|
||||
use crate::models::{Accommodation, AccommodationReservationID, NewAccommodationReservation};
|
||||
use crate::services::accommodations_reservations_service;
|
||||
use crate::utils::time_utils::time;
|
||||
use actix_web::{web, HttpResponse};
|
||||
use actix_web::{HttpResponse, web};
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct UpdateReservationQuery {
|
||||
|
@ -5,7 +5,7 @@ use crate::services::login_token_service::LoginTokenValue;
|
||||
use crate::services::rate_limiter_service::RatedAction;
|
||||
use crate::services::{login_token_service, openid_service, rate_limiter_service, users_service};
|
||||
use actix_remote_ip::RemoteIP;
|
||||
use actix_web::{web, HttpResponse};
|
||||
use actix_web::{HttpResponse, web};
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct CreateAccountBody {
|
||||
|
@ -1,12 +1,12 @@
|
||||
use crate::controllers::members_controller::RequestDate;
|
||||
use crate::controllers::HttpResult;
|
||||
use crate::controllers::members_controller::RequestDate;
|
||||
use crate::extractors::couple_extractor::FamilyAndCoupleInPath;
|
||||
use crate::extractors::family_extractor::FamilyInPath;
|
||||
use crate::models::{Couple, CoupleState, MemberID, PhotoID};
|
||||
use crate::services::{couples_service, members_service, photos_service};
|
||||
use actix_multipart::form::tempfile::TempFile;
|
||||
use actix_multipart::form::MultipartForm;
|
||||
use actix_web::{web, HttpResponse};
|
||||
use actix_multipart::form::tempfile::TempFile;
|
||||
use actix_web::{HttpResponse, web};
|
||||
|
||||
serde_with::with_prefix!(prefix_wedding "wedding_");
|
||||
serde_with::with_prefix!(prefix_divorce "divorce_");
|
||||
|
@ -1,14 +1,14 @@
|
||||
use crate::connections::s3_connection;
|
||||
use crate::constants;
|
||||
use crate::controllers::HttpResult;
|
||||
use crate::controllers::couples_controller::CoupleRequest;
|
||||
use crate::controllers::members_controller::MemberRequest;
|
||||
use crate::controllers::HttpResult;
|
||||
use crate::extractors::family_extractor::{FamilyInPath, FamilyInPathWithAdminMembership};
|
||||
use crate::models::{CoupleID, MemberID, PhotoID};
|
||||
use crate::services::photos_service::UploadedFile;
|
||||
use crate::services::{couples_service, members_service, photos_service};
|
||||
use actix_multipart::form::tempfile::TempFile;
|
||||
use actix_multipart::form::MultipartForm;
|
||||
use actix_multipart::form::tempfile::TempFile;
|
||||
use actix_web::HttpResponse;
|
||||
use mime_guess::Mime;
|
||||
use std::collections::HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::constants::{StaticConstraints, FAMILY_INVITATION_CODE_LEN};
|
||||
use crate::constants::{FAMILY_INVITATION_CODE_LEN, StaticConstraints};
|
||||
use crate::controllers::HttpResult;
|
||||
use crate::extractors::family_extractor::{FamilyInPath, FamilyInPathWithAdminMembership};
|
||||
use crate::models::{FamilyMembership, UserID};
|
||||
@ -7,7 +7,7 @@ use crate::services::rate_limiter_service::RatedAction;
|
||||
use crate::services::{families_service, rate_limiter_service};
|
||||
use crate::utils::string_utils::rand_str;
|
||||
use actix_remote_ip::RemoteIP;
|
||||
use actix_web::{web, HttpResponse};
|
||||
use actix_web::{HttpResponse, web};
|
||||
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
pub struct CreateFamilyReq {
|
||||
|
@ -5,9 +5,9 @@ use crate::extractors::member_extractor::FamilyAndMemberInPath;
|
||||
use crate::models::{Member, MemberID, PhotoID, Sex};
|
||||
use crate::services::{members_service, photos_service};
|
||||
use crate::utils::countries_utils;
|
||||
use actix_multipart::form::tempfile::TempFile;
|
||||
use actix_multipart::form::MultipartForm;
|
||||
use actix_web::{web, HttpResponse};
|
||||
use actix_multipart::form::tempfile::TempFile;
|
||||
use actix_web::{HttpResponse, web};
|
||||
|
||||
serde_with::with_prefix!(prefix_birth "birth_");
|
||||
serde_with::with_prefix!(prefix_death "death_");
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! # API controller
|
||||
|
||||
use actix_web::body::BoxBody;
|
||||
use actix_web::HttpResponse;
|
||||
use actix_web::body::BoxBody;
|
||||
use std::fmt::{Debug, Display, Formatter};
|
||||
use zip::result::ZipError;
|
||||
|
||||
|
@ -3,7 +3,7 @@ use crate::controllers::HttpResult;
|
||||
use crate::models::PhotoID;
|
||||
use crate::services::photos_service;
|
||||
use actix_web::http::header;
|
||||
use actix_web::{web, HttpRequest, HttpResponse};
|
||||
use actix_web::{HttpRequest, HttpResponse, web};
|
||||
use std::ops::Add;
|
||||
use std::time::{Duration, UNIX_EPOCH};
|
||||
|
||||
|
@ -9,8 +9,8 @@ use crate::services::login_token_service::LoginToken;
|
||||
use crate::services::rate_limiter_service::RatedAction;
|
||||
use crate::services::{rate_limiter_service, users_service};
|
||||
use actix_remote_ip::RemoteIP;
|
||||
use actix_web::web::Json;
|
||||
use actix_web::HttpResponse;
|
||||
use actix_web::web::Json;
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct UserAPI<'a> {
|
||||
|
@ -2,7 +2,7 @@ use actix_cors::Cors;
|
||||
use actix_multipart::form::tempfile::TempFileConfig;
|
||||
use actix_remote_ip::RemoteIPConfig;
|
||||
use actix_web::middleware::Logger;
|
||||
use actix_web::{web, App, HttpServer};
|
||||
use actix_web::{App, HttpServer, web};
|
||||
use geneit_backend::app_config::AppConfig;
|
||||
use geneit_backend::connections::{db_connection, s3_connection};
|
||||
use geneit_backend::controllers::{
|
||||
|
@ -9,7 +9,7 @@ use crate::utils::string_utils::rand_str;
|
||||
use crate::utils::time_utils::time;
|
||||
use actix_web::dev::Payload;
|
||||
use actix_web::{FromRequest, HttpRequest};
|
||||
use std::future::{ready, Ready};
|
||||
use std::future::{Ready, ready};
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
enum LoginTokenServiceError {
|
||||
|
@ -3,8 +3,8 @@ use crate::models::{FamilyID, Member, MemberID, NewMember};
|
||||
use crate::schema::members;
|
||||
use crate::services::{couples_service, photos_service};
|
||||
use crate::utils::time_utils::time;
|
||||
use diesel::prelude::*;
|
||||
use diesel::RunQueryDsl;
|
||||
use diesel::prelude::*;
|
||||
|
||||
/// Create a new family member
|
||||
pub async fn create(family_id: FamilyID) -> anyhow::Result<Member> {
|
||||
@ -188,7 +188,10 @@ pub mod loop_detection {
|
||||
let member = match members.get(&curr_stack.curr) {
|
||||
Some(m) => m,
|
||||
None => {
|
||||
log::warn!("Member {:?} not found in the tree for loop detection, this should never happen!", curr_stack.curr);
|
||||
log::warn!(
|
||||
"Member {:?} not found in the tree for loop detection, this should never happen!",
|
||||
curr_stack.curr
|
||||
);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
@ -6,8 +6,8 @@ use crate::utils::crypt_utils::sha512;
|
||||
use crate::utils::time_utils::time;
|
||||
use actix_multipart::form::tempfile::TempFile;
|
||||
use diesel::prelude::*;
|
||||
use image::imageops::FilterType;
|
||||
use image::ImageFormat;
|
||||
use image::imageops::FilterType;
|
||||
use mime_guess::Mime;
|
||||
use std::fs::File;
|
||||
use std::io::{Cursor, Read, Seek, Write};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use base64::{engine::general_purpose, Engine as _};
|
||||
use base64::{Engine as _, engine::general_purpose};
|
||||
|
||||
/// Encode a base64 string
|
||||
pub fn base64_enc<T: AsRef<[u8]>>(b: T) -> String {
|
||||
|
@ -3,4 +3,4 @@ use rand::distr::{Alphanumeric, SampleString};
|
||||
/// Generate a random string of a given length
|
||||
pub fn rand_str(len: usize) -> String {
|
||||
Alphanumeric.sample_string(&mut rand::rng(), len)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user