chore: remove all compiler and clippy warnings
parent
f3ede6f9a6
commit
279983c64c
|
@ -17,10 +17,8 @@ use crate::schema::*;
|
|||
pub struct Device {
|
||||
pub id: i64,
|
||||
pub device_id: String,
|
||||
pub user_id: i64,
|
||||
pub caption: String,
|
||||
pub type_: DeviceType,
|
||||
pub sync_group_id: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
|
|
|
@ -6,8 +6,6 @@ use crate::schema::*;
|
|||
#[diesel(table_name = device_subscriptions)]
|
||||
#[diesel(check_for_backend(diesel::sqlite::Sqlite))]
|
||||
pub struct DeviceSubscription {
|
||||
pub id: i64,
|
||||
pub device_id: i64,
|
||||
pub podcast_url: String,
|
||||
pub time_changed: i64,
|
||||
pub deleted: bool,
|
||||
|
|
|
@ -16,9 +16,6 @@ use crate::schema::*;
|
|||
#[diesel(table_name = episode_actions)]
|
||||
#[diesel(check_for_backend(diesel::sqlite::Sqlite))]
|
||||
pub struct EpisodeAction {
|
||||
pub id: i64,
|
||||
pub user_id: i64,
|
||||
pub device_id: Option<i64>,
|
||||
pub podcast_url: String,
|
||||
pub episode_url: String,
|
||||
pub time_changed: i64,
|
||||
|
|
|
@ -20,7 +20,7 @@ use crate::server::{
|
|||
pub fn router() -> Router<Context> {
|
||||
Router::new()
|
||||
.route("/{username}/login.json", post(post_login))
|
||||
.route("/{username}/logout.json", post(post_logout))
|
||||
.route("/{_username}/logout.json", post(post_logout))
|
||||
}
|
||||
|
||||
async fn post_login(
|
||||
|
@ -85,7 +85,7 @@ async fn post_login(
|
|||
|
||||
async fn post_logout(
|
||||
State(ctx): State<Context>,
|
||||
Path(username): Path<String>,
|
||||
Path(_username): Path<String>,
|
||||
jar: CookieJar,
|
||||
) -> AppResult<CookieJar> {
|
||||
if let Some(session_id) = jar.get(SESSION_ID_COOKIE) {
|
||||
|
|
|
@ -19,7 +19,10 @@ pub fn router(ctx: Context) -> Router<Context> {
|
|||
Router::new()
|
||||
.route("/{username}", get(get_devices))
|
||||
.route("/{username}/{id}", post(post_device))
|
||||
.layer(middleware::from_fn_with_state(ctx.clone(), auth_api_middleware))
|
||||
.layer(middleware::from_fn_with_state(
|
||||
ctx.clone(),
|
||||
auth_api_middleware,
|
||||
))
|
||||
}
|
||||
|
||||
async fn get_devices(
|
||||
|
|
|
@ -22,7 +22,10 @@ pub fn router(ctx: Context) -> Router<Context> {
|
|||
"/{username}/{id}",
|
||||
post(post_subscription_changes).get(get_subscription_changes),
|
||||
)
|
||||
.layer(middleware::from_fn_with_state(ctx.clone(), auth_api_middleware))
|
||||
.layer(middleware::from_fn_with_state(
|
||||
ctx.clone(),
|
||||
auth_api_middleware,
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn post_subscription_changes(
|
||||
|
|
|
@ -21,7 +21,10 @@ pub fn router(ctx: Context) -> Router<Context> {
|
|||
"/{username}",
|
||||
get(get_sync_status).post(post_sync_status_changes),
|
||||
)
|
||||
.layer(middleware::from_fn_with_state(ctx.clone(), auth_api_middleware))
|
||||
.layer(middleware::from_fn_with_state(
|
||||
ctx.clone(),
|
||||
auth_api_middleware,
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn get_sync_status(
|
||||
|
|
|
@ -34,7 +34,7 @@ impl<'de> Deserialize<'de> for StringWithFormat {
|
|||
{
|
||||
struct StrVisitor;
|
||||
|
||||
impl<'de> Visitor<'de> for StrVisitor {
|
||||
impl Visitor<'_> for StrVisitor {
|
||||
type Value = StringWithFormat;
|
||||
|
||||
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
|
|
|
@ -18,7 +18,10 @@ pub fn router(ctx: Context) -> Router<Context> {
|
|||
get(get_device_subscriptions).put(put_device_subscriptions),
|
||||
)
|
||||
.route("/{username}", get(get_user_subscriptions))
|
||||
.layer(middleware::from_fn_with_state(ctx.clone(), auth_api_middleware))
|
||||
.layer(middleware::from_fn_with_state(
|
||||
ctx.clone(),
|
||||
auth_api_middleware,
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn get_device_subscriptions(
|
||||
|
|
Loading…
Reference in New Issue