mirror of
https://github.com/house-of-vanity/furumi.git
synced 2025-07-07 05:34:07 +00:00
Linting
This commit is contained in:
@ -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(),
|
||||
}
|
||||
}
|
||||
|
@ -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<Ino, Arc<Mutex<INode>>>,
|
||||
@ -46,10 +47,12 @@ impl INodeTable {
|
||||
VacantEntry { table: self, ino }
|
||||
}
|
||||
|
||||
//noinspection RsUnresolvedReference
|
||||
fn get(&self, ino: Ino) -> Option<Arc<Mutex<INode>>> {
|
||||
self.map.get(&ino).cloned()
|
||||
}
|
||||
|
||||
//noinspection RsUnresolvedReference
|
||||
fn remove(&mut self, ino: Ino) -> Option<Arc<Mutex<INode>>> {
|
||||
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<Arc<DirEntry>>,
|
||||
}
|
||||
|
||||
//noinspection RsUnresolvedReference
|
||||
//noinspection RsUnresolvedReference
|
||||
//noinspection RsUnresolvedReference
|
||||
#[derive(Debug)]
|
||||
pub struct MemFS {
|
||||
inodes: Mutex<INodeTable>,
|
||||
@ -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<ReplyOpen> {
|
||||
error!("do_opendir: {:?}", op);
|
||||
|
||||
|
10
src/http.rs
10
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,
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user