chore: clippy warning fixes and formatting
This commit is contained in:
parent
d14558ce45
commit
5502f21605
6 changed files with 23 additions and 41 deletions
|
|
@ -45,7 +45,7 @@ pub struct GeoIpService {
|
|||
|
||||
impl GeoIpService {
|
||||
pub fn new(config: Config) -> Result<Self, Box<dyn std::error::Error>> {
|
||||
let path = config.geo_files.get(0).unwrap();
|
||||
let path = config.geo_files.first().unwrap();
|
||||
let reader = Reader::open_readfile(path)?;
|
||||
Ok(Self { reader })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use crate::geoparsers::v2ray::parsing::decode_geosite_stream;
|
|||
use crate::geoparsers::v2ray::types::{GeoSite, GeoSiteList};
|
||||
|
||||
use std::fs;
|
||||
use std::io::{BufReader, Read};
|
||||
use std::io::BufReader;
|
||||
|
||||
pub struct GeoSiteService {
|
||||
index: GeoSiteList,
|
||||
|
|
|
|||
|
|
@ -33,17 +33,7 @@ pub mod domain {
|
|||
}
|
||||
}
|
||||
/// Type of domain value.
|
||||
#[derive(
|
||||
Clone,
|
||||
Copy,
|
||||
Debug,
|
||||
PartialEq,
|
||||
Eq,
|
||||
Hash,
|
||||
PartialOrd,
|
||||
Ord,
|
||||
::prost::Enumeration
|
||||
)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
||||
#[repr(i32)]
|
||||
pub enum Type {
|
||||
/// The value is used as is.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue