Skip to content

Commit

Permalink
Run clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alisinabh committed May 8, 2024
1 parent 5d9f8a9 commit ca3a1b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl<'a> LookupResult<'a> {
.schema_type(utoipa::openapi::SchemaType::Object)
.title(Some("AnonymousIpLookupResult"));

const BOOLEAN_FIELDS: &'static [&'static str] = &[
const BOOLEAN_FIELDS: &[&str] = &[
"is_anonymous",
"is_anonymous_vpn",
"is_hosting_provider",
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::io::{Error, ErrorKind, Result};
use atlas_rs::api_docs;
use tokio::io::AsyncWriteExt;

const SPEC_FILENAME: &'static str = "openapi-spec.json";
const SPEC_FILENAME: &str = "openapi-spec.json";

#[actix_web::main]
async fn main() -> Result<()> {
Expand All @@ -27,7 +27,7 @@ async fn main() -> Result<()> {
.parse()
.expect("Invalid SWAGGER_UI_ENABLED value. Expected `false` or `true`");

let subcommand = env::args().skip(1).next();
let subcommand = env::args().nth(1);

match subcommand.as_deref() {
Some("server") | None => {
Expand Down
6 changes: 3 additions & 3 deletions src/maxmind_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ pub struct MaxmindDBInner {

impl<'de> MaxmindDB {
pub async fn init(variant: &str, base_path: &str) -> Result<Self, Box<dyn Error>> {
let db_path = match Self::get_latest_variant(&variant, &base_path).await? {
let db_path = match Self::get_latest_variant(variant, base_path).await? {
Some(db) => db,
None => {
println!("No database found! Fetching latest from upstream...");
Self::fetch_latest_db(&variant, &base_path).await?
Self::fetch_latest_db(variant, base_path).await?
}
};

let inner_db = MaxmindDBInner::load(&db_path, &variant)?;
let inner_db = MaxmindDBInner::load(db_path, variant)?;

Ok(Self {
db: RwLock::new(inner_db),
Expand Down

0 comments on commit ca3a1b4

Please sign in to comment.