From 36ff41debe9d810170bfbade0730465b72e76541 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 21 Feb 2022 23:32:21 -0500 Subject: [PATCH] Cleanup --- src/main.rs | 4 ---- src/mpvctl/command.rs | 2 +- src/mpvctl/mpv_framed.rs | 2 +- src/mpvctl/mpvctl.rs | 8 ++------ 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index b909928..2ac188b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ use sqlx::sqlite::SqliteConnectOptions; -use sqlx::sqlite::SqlitePool; use sqlx::Connection; use sqlx::Row; use std::{env, str::FromStr}; @@ -41,9 +40,6 @@ async fn main() -> Result<(), Box> { .journal_mode(sqlx::sqlite::SqliteJournalMode::Delete), ) .await?; - // let pool = - // SqlitePool::connect_with(SqliteConnectOptions::from_str(&url)?.create_if_missing(true)) - // .await?; sqlx::migrate!("./migrations").run(&mut dbconn).await?; let profiles_created: u64 = sqlx::query(r#"INSERT OR IGNORE INTO profile (name) VALUES (?)"#) diff --git a/src/mpvctl/command.rs b/src/mpvctl/command.rs index 2521991..af6a299 100644 --- a/src/mpvctl/command.rs +++ b/src/mpvctl/command.rs @@ -1,5 +1,5 @@ use serde::ser::SerializeMap; -use serde::{Deserialize, Serialize, Serializer}; +use serde::{Serialize, Serializer}; pub struct Command { command: Vec, diff --git a/src/mpvctl/mpv_framed.rs b/src/mpvctl/mpv_framed.rs index 9cb5de7..df1818a 100644 --- a/src/mpvctl/mpv_framed.rs +++ b/src/mpvctl/mpv_framed.rs @@ -1,5 +1,5 @@ use bytes::{Buf, BytesMut}; -use std::io::{self, Cursor}; +use std::io::Cursor; use tokio::{io::AsyncReadExt, net::unix::OwnedReadHalf}; pub struct MpvFramed { diff --git a/src/mpvctl/mpvctl.rs b/src/mpvctl/mpvctl.rs index 4512373..9cabad4 100644 --- a/src/mpvctl/mpvctl.rs +++ b/src/mpvctl/mpvctl.rs @@ -1,14 +1,10 @@ use super::command::Command; use super::mpv_framed::MpvFramed; -use bytes::BytesMut; -use std::borrow::BorrowMut; use std::collections::hash_map::Entry; use std::collections::HashMap; -use std::io::Read; -use std::os::unix::prelude::OsStrExt; +use std::path::Path; use std::sync::{Arc, Mutex}; -use std::{collections::BTreeMap, path::Path}; -use tokio::io::{AsyncReadExt, AsyncWriteExt}; +use tokio::io::AsyncWriteExt; use tokio::net::unix::OwnedWriteHalf; use tokio::net::UnixStream; use tokio::sync::mpsc;