From 6c5f2d05ca200c53d39c3eccfd10306d26607487 Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Sun, 21 Apr 2024 15:18:24 +0200 Subject: [PATCH] clippy Signed-off-by: Frank Villaro-Dixon --- src/dem.rs | 4 ++-- src/main.rs | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/dem.rs b/src/dem.rs index efd5e69..0f4946c 100644 --- a/src/dem.rs +++ b/src/dem.rs @@ -1,7 +1,7 @@ use std::sync::Arc; +use gdal::errors::GdalError; use gdal::Dataset; -use gdal::{errors::GdalError, GeoTransformEx}; use tracing::{debug, debug_span, error, info}; @@ -42,7 +42,7 @@ impl DatasetRepository { return None; } Ok(ds) => { - let mds = Arc::new(MyDataset { ds: ds }); + let mds = Arc::new(MyDataset { ds }); self.cache.insert(full_filename.clone(), mds).await; } } diff --git a/src/main.rs b/src/main.rs index 5b6bf71..3d2fadf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,25 +2,23 @@ mod dem; use axum::{ extract::{Extension, Path, Query, State}, - http::{response, StatusCode}, + http::StatusCode, response::{IntoResponse, Response}, routing::get, Json, Router, }; use axum_macros::debug_handler; -use std::{borrow::Borrow, fmt}; -use std::{env, str::FromStr}; -use tokio::sync::mpsc::error; +use std::env; use serde::ser::{SerializeSeq, Serializer}; use serde::{Deserialize, Deserializer, Serialize}; -use serde_qs::axum::{QsQuery, QsQueryConfig, QsQueryRejection}; +use serde_qs::axum::{QsQueryConfig, QsQueryRejection}; use tower_http::trace::TraceLayer; use tower_http::{ services::ServeDir, - trace::{self, DefaultMakeSpan}, + trace::{self}, }; -use tracing::{error, info, Level, Span}; +use tracing::{error, info, Level}; use dem::DatasetRepository; @@ -153,9 +151,9 @@ async fn get_elevation( if query_opts.json { let r = Ele { elevation: ele }; - return Json(r).into_response(); + Json(r).into_response() } else { - return format!("{}", ele).into_response(); + format!("{}", ele).into_response() } }