Skip to content

Commit

Permalink
fix waning because Reuslt duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
jokemanfire committed Sep 4, 2024
1 parent f5b1157 commit 5689a1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub use mysql_async::prelude::*;
pub use mysql_async::*;
use std::convert::Infallible;
use std::net::SocketAddr;
use std::result::Result;
use std::result::Result as StdResult;
use std::collections::HashMap;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -57,7 +57,7 @@ impl Order {
}
}

async fn handle_request(req: Request<Body>, pool: Pool) -> Result<Response<Body>, anyhow::Error> {
async fn handle_request(req: Request<Body>, pool: Pool) -> StdResult<Response<Body>, anyhow::Error> {
match (req.method(), req.uri().path()) {
(&Method::GET, "/") => Ok(Response::new(Body::from(
"The valid endpoints are /init /create_order /create_orders /update_order /orders /delete_order",
Expand Down Expand Up @@ -216,7 +216,7 @@ fn response_build(body: &str) -> Response<Body> {
}

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
async fn main() -> StdResult<(), Box<dyn std::error::Error + Send + Sync>> {
let opts = Opts::from_url(&*get_url()).unwrap();
let builder = OptsBuilder::from_opts(opts);
// The connection pool will have a min of 5 and max of 10 connections.
Expand Down

0 comments on commit 5689a1d

Please sign in to comment.