diff --git a/Cargo.lock b/Cargo.lock index 1107d37..210da58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -847,7 +847,7 @@ dependencies = [ [[package]] name = "mpvipc-async" version = "0.1.0" -source = "git+https://git.pvv.ntnu.no/Grzegorz/mpvipc-async.git?branch=main#0934dba9a5d1a7ab832605d2781f43625f25bfad" +source = "git+https://git.pvv.ntnu.no/Grzegorz/mpvipc-async.git?branch=main#c4b77dd1987e5ad02a9365cb157f76ca986371f8" dependencies = [ "futures", "log", diff --git a/Cargo.toml b/Cargo.toml index 227d6fd..c707eaa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "greg-ng" version = "0.1.0" -edition = "2021" +edition = "2024" license = "GPL-3.0" authors = ["projects@pvv.ntnu.no"] readme = "README.md" diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..3501136 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +style_edition = "2024" diff --git a/src/api/base.rs b/src/api/base.rs index 8f0833e..9e2894d 100644 --- a/src/api/base.rs +++ b/src/api/base.rs @@ -2,7 +2,7 @@ use mpvipc_async::{ LoopProperty, Mpv, MpvExt, NumberChangeOptions, PlaylistAddOptions, PlaylistAddTypeOptions, SeekOptions, Switch, }; -use serde_json::{json, Value}; +use serde_json::{Value, json}; /// Add item to playlist pub async fn loadfile(mpv: Mpv, path: &str) -> anyhow::Result<()> { diff --git a/src/api/rest_wrapper_v1.rs b/src/api/rest_wrapper_v1.rs index db639b5..622b6cd 100644 --- a/src/api/rest_wrapper_v1.rs +++ b/src/api/rest_wrapper_v1.rs @@ -1,12 +1,12 @@ use axum::{ + Json, Router, extract::{Query, State}, http::StatusCode, response::{IntoResponse, Response}, routing::{delete, get, post}, - Json, Router, }; use mpvipc_async::Mpv; -use serde_json::{json, Value}; +use serde_json::{Value, json}; use utoipa::OpenApi; use utoipa_axum::{router::OpenApiRouter, routes}; diff --git a/src/api/websocket_v1.rs b/src/api/websocket_v1.rs index 429e4af..8c49f57 100644 --- a/src/api/websocket_v1.rs +++ b/src/api/websocket_v1.rs @@ -4,23 +4,23 @@ use std::{ }; use anyhow::Context; -use futures::{stream::FuturesUnordered, StreamExt}; +use futures::{StreamExt, stream::FuturesUnordered}; use serde::{Deserialize, Serialize}; use axum::{ + Router, extract::{ - ws::{Message, WebSocket}, ConnectInfo, State, WebSocketUpgrade, + ws::{Message, WebSocket}, }, response::IntoResponse, routing::any, - Router, }; use mpvipc_async::{ LoopProperty, Mpv, MpvExt, NumberChangeOptions, Playlist, PlaylistAddTypeOptions, SeekOptions, Switch, }; -use serde_json::{json, Value}; +use serde_json::{Value, json}; use tokio::{ select, sync::{mpsc, watch},