diff --git a/src/config.rs b/src/config.rs index 0397026..a32b0f1 100644 --- a/src/config.rs +++ b/src/config.rs @@ -76,10 +76,10 @@ pub fn read() -> Config { warn!("Insecure server detected. Set `username` and `password` directives to use auth."); } Config { - server: server, - username: username, - password: password, - mountpoint: mountpoint, + server, + username, + password, + mountpoint, conf_file: config_file.to_string(), } } diff --git a/src/filesystem.rs b/src/filesystem.rs index 5171989..fc04fd9 100644 --- a/src/filesystem.rs +++ b/src/filesystem.rs @@ -11,9 +11,9 @@ use polyfuse::{ Context, DirEntry, FileAttr, Filesystem, Forget, Operation, }; use slab::Slab; -use std::error::Error; -use std::mem::swap; -use std::path::{Path, PathBuf}; + + +use std::path::{PathBuf}; use std::{ collections::hash_map::{Entry, HashMap}, ffi::{OsStr, OsString}, @@ -27,6 +27,7 @@ use tracing_futures::Instrument; type Ino = u64; +//noinspection RsUnresolvedReference #[derive(Debug)] struct INodeTable { map: HashMap>>, @@ -46,10 +47,12 @@ impl INodeTable { VacantEntry { table: self, ino } } + //noinspection RsUnresolvedReference fn get(&self, ino: Ino) -> Option>> { self.map.get(&ino).cloned() } + //noinspection RsUnresolvedReference fn remove(&mut self, ino: Ino) -> Option>> { self.map.remove(&ino) } @@ -66,6 +69,7 @@ impl VacantEntry<'_> { self.ino } + //noinspection RsUnresolvedReference fn insert(self, inode: INode) { let Self { table, ino } = self; table.map.insert(ino, Arc::new(Mutex::new(inode))); @@ -124,6 +128,9 @@ struct DirHandle { entries: Vec>, } +//noinspection RsUnresolvedReference +//noinspection RsUnresolvedReference +//noinspection RsUnresolvedReference #[derive(Debug)] pub struct MemFS { inodes: Mutex, @@ -133,6 +140,8 @@ pub struct MemFS { } impl MemFS { + //noinspection RsUnresolvedReference + //noinspection RsUnresolvedReference pub fn new(cfg: &config::Config) -> Self { let mut inodes = INodeTable::new(); //let self.cfg = cfg; @@ -383,7 +392,7 @@ impl MemFS { _ => None, } } - Err(e) => None, + Err(_e) => None, } } @@ -597,6 +606,7 @@ impl MemFS { Some((uri, parent_ino)) } + //noinspection RsUnresolvedReference async fn do_opendir(&self, op: &op::Opendir<'_>) -> io::Result { error!("do_opendir: {:?}", op); diff --git a/src/http.rs b/src/http.rs index f8df3e8..49d858f 100644 --- a/src/http.rs +++ b/src/http.rs @@ -1,11 +1,7 @@ extern crate base64; -use reqwest::{blocking::Client, header::CONTENT_LENGTH}; + use serde::Deserialize; use std::{ - collections::{BTreeMap, HashMap, HashSet}, - env, - ffi::OsStr, - fmt, path::PathBuf, process, thread::sleep, @@ -27,8 +23,8 @@ impl RemoteEntry { } } -use chrono::format::ParseError; -use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime}; + +use chrono::{DateTime}; pub async fn list_directory( server: &std::string::String, diff --git a/src/main.rs b/src/main.rs index 64dec96..5ef2dab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; #[macro_use] extern crate log; use env_logger::Env; -use std::{path::Path, process}; +use std::{process}; mod config; mod filesystem;