Fix compiler warnings
- Remove unused import in auth handler - Remove unused PreferencesService export - Fix unused mutable variable in preferences - Remove unused display_name method from Style enum - Add dead_code attributes for future preferences service 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,6 @@ use axum::{extract::State, http::HeaderMap, response::Json};
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::calendar::CalDAVClient;
|
use crate::calendar::CalDAVClient;
|
||||||
use crate::config::CalDAVConfig;
|
|
||||||
use crate::{
|
use crate::{
|
||||||
models::{ApiError, AuthResponse, CalDAVLoginRequest, CalendarInfo, UserInfo},
|
models::{ApiError, AuthResponse, CalDAVLoginRequest, CalendarInfo, UserInfo},
|
||||||
AppState,
|
AppState,
|
||||||
|
|||||||
@@ -81,12 +81,6 @@ impl Style {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn display_name(&self) -> &'static str {
|
|
||||||
match self {
|
|
||||||
Style::Default => "Default",
|
|
||||||
Style::Google => "Google Calendar",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn stylesheet_path(&self) -> Option<&'static str> {
|
pub fn stylesheet_path(&self) -> Option<&'static str> {
|
||||||
match self {
|
match self {
|
||||||
|
|||||||
@@ -2,4 +2,3 @@ pub mod calendar_service;
|
|||||||
pub mod preferences;
|
pub mod preferences;
|
||||||
|
|
||||||
pub use calendar_service::CalendarService;
|
pub use calendar_service::CalendarService;
|
||||||
pub use preferences::PreferencesService;
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ pub struct UserPreferences {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct UpdatePreferencesRequest {
|
pub struct UpdatePreferencesRequest {
|
||||||
pub calendar_selected_date: Option<String>,
|
pub calendar_selected_date: Option<String>,
|
||||||
pub calendar_time_increment: Option<i32>,
|
pub calendar_time_increment: Option<i32>,
|
||||||
@@ -23,10 +24,12 @@ pub struct UpdatePreferencesRequest {
|
|||||||
pub calendar_colors: Option<String>,
|
pub calendar_colors: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct PreferencesService {
|
pub struct PreferencesService {
|
||||||
base_url: String,
|
base_url: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
impl PreferencesService {
|
impl PreferencesService {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let base_url = option_env!("BACKEND_API_URL")
|
let base_url = option_env!("BACKEND_API_URL")
|
||||||
@@ -147,7 +150,7 @@ impl PreferencesService {
|
|||||||
let session_token = LocalStorage::get::<String>("session_token")
|
let session_token = LocalStorage::get::<String>("session_token")
|
||||||
.map_err(|_| "No session token found".to_string())?;
|
.map_err(|_| "No session token found".to_string())?;
|
||||||
|
|
||||||
let mut request = UpdatePreferencesRequest {
|
let request = UpdatePreferencesRequest {
|
||||||
calendar_selected_date: LocalStorage::get::<String>("calendar_selected_date").ok(),
|
calendar_selected_date: LocalStorage::get::<String>("calendar_selected_date").ok(),
|
||||||
calendar_time_increment: LocalStorage::get::<u32>("calendar_time_increment").ok().map(|i| i as i32),
|
calendar_time_increment: LocalStorage::get::<u32>("calendar_time_increment").ok().map(|i| i as i32),
|
||||||
calendar_view_mode: LocalStorage::get::<String>("calendar_view_mode").ok(),
|
calendar_view_mode: LocalStorage::get::<String>("calendar_view_mode").ok(),
|
||||||
|
|||||||
Reference in New Issue
Block a user