style: Clean up backend unused warnings

This commit is contained in:
spinline
2026-01-30 01:00:36 +03:00
parent 8216f0556a
commit 6424acaa08
4 changed files with 9 additions and 13 deletions

View File

@@ -11,10 +11,9 @@ mod xmlrpc;
use clap::Parser;
use rust_embed::RustEmbed;
use axum::{
body::Body,
extract::{Path, State},
extract::State,
http::{header, StatusCode, Uri},
response::{IntoResponse, Response},
response::IntoResponse,
routing::{get, post},
Router, Json,
};

View File

@@ -1,11 +1,13 @@
use bytes::{BufMut, Bytes, BytesMut};
use bytes::Bytes;
use std::collections::HashMap;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::net::UnixStream;
#[derive(Debug)]
pub enum ScgiError {
#[allow(dead_code)]
Io(std::io::Error),
#[allow(dead_code)]
Protocol(String),
}
@@ -30,7 +32,7 @@ impl ScgiRequest {
}
}
pub fn header(mut self, key: &str, value: &str) -> Self {
pub fn _header(mut self, key: &str, value: &str) -> Self {
self.headers.insert(key.to_string(), value.to_string());
self
}

View File

@@ -1,6 +1,6 @@
use axum::response::sse::{Event, Sse};
use futures::stream::{self, Stream};
use std::{convert::Infallible, time::Duration};
use std::convert::Infallible;
use tokio_stream::StreamExt;
use crate::models::{AppEvent, Torrent};
use crate::xmlrpc::{RtorrentClient, parse_multicall_response};
@@ -10,11 +10,6 @@ fn parse_size(s: &str) -> i64 {
s.parse().unwrap_or(0)
}
fn parse_float(s: &str) -> f64 {
// rTorrent usually returns integers for bytes done etc.
// We might need to handle empty strings.
s.parse().unwrap_or(0.0)
}
pub async fn fetch_torrents(client: &RtorrentClient) -> Result<Vec<Torrent>, String> {
// d.multicall2("", "main", ...)

View File

@@ -1,7 +1,7 @@
use crate::scgi::{send_request, ScgiRequest};
use quick_xml::events::Event;
use quick_xml::reader::Reader;
use serde::Deserialize;
// Simple helper to build an XML-RPC method call
pub fn build_method_call(method: &str, params: &[&str]) -> String {
@@ -159,7 +159,7 @@ pub fn parse_string_response(xml: &str) -> Result<String, String> {
}
Ok(Event::End(ref e)) => {
if e.name().as_ref() == b"string" {
inside_string = false;
// inside_string = false;
// Assuming only one string in the response which matters
break;
}