From 33a4cce0b97832f5f0301b318a0a50073ce6b615 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 15 May 2018 00:33:33 -0700 Subject: revert to v2.3.1 codegen This reverts back to something compatible with Iron and simple (blocking) parallelism, instead of the new async hyper 0.11 stuff. --- rust/src/lib.rs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'rust/src/lib.rs') diff --git a/rust/src/lib.rs b/rust/src/lib.rs index ec7193e6..fbff6ab2 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -20,9 +20,6 @@ use diesel::pg::PgConnection; use diesel::prelude::*; use dotenv::dotenv; use std::env; -use std::io; -//use hyper; -//use fatcat_api; pub fn establish_connection() -> PgConnection { dotenv().ok(); @@ -31,16 +28,7 @@ pub fn establish_connection() -> PgConnection { PgConnection::establish(&database_url).expect(&format!("Error connecting to {}", database_url)) } -pub struct NewService; - -impl hyper::server::NewService for NewService { - type Request = (hyper::Request, fatcat_api::Context); - type Response = hyper::Response; - type Error = hyper::Error; - type Instance = fatcat_api::server::Service; - - /// Instantiate a new server. - fn new_service(&self) -> io::Result { - Ok(fatcat_api::server::Service::new(api_server::Server)) - } +/// Instantiate a new server. +pub fn server() -> Result { + Ok(api_server::Server {}) } -- cgit v1.2.3