summaryrefslogtreecommitdiffstats
path: root/rust/src/bin
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-10 19:09:45 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-10 19:09:45 -0800
commitfbe91ab8e6100c87ee9353e177d11b0c0b952661 (patch)
tree9c06dc80229eb66d843205e206d1f6e85b1f48b0 /rust/src/bin
parent4fd476bdeca596b97521846629272d96d8e023c4 (diff)
downloadfatcat-fbe91ab8e6100c87ee9353e177d11b0c0b952661.tar.gz
fatcat-fbe91ab8e6100c87ee9353e177d11b0c0b952661.zip
narrow down many glob imports
Diffstat (limited to 'rust/src/bin')
-rw-r--r--rust/src/bin/fatcat-auth.rs8
-rw-r--r--rust/src/bin/fatcat-export.rs10
-rw-r--r--rust/src/bin/fatcatd.rs6
3 files changed, 10 insertions, 14 deletions
diff --git a/rust/src/bin/fatcat-auth.rs b/rust/src/bin/fatcat-auth.rs
index 9efd47ed..85132023 100644
--- a/rust/src/bin/fatcat-auth.rs
+++ b/rust/src/bin/fatcat-auth.rs
@@ -2,11 +2,9 @@
use clap::{App, SubCommand};
-use fatcat::auth;
-use fatcat::editing;
-use fatcat::errors::*;
+use fatcat::{auth, editing, server};
+use fatcat::errors::Result;
use fatcat::identifiers::FatcatId;
-use fatcat::server::*;
use std::process;
use std::str::FromStr;
@@ -68,7 +66,7 @@ fn main() -> Result<()> {
}
// Then the ones that do
- let db_conn = database_worker_pool()?.get().expect("database pool");
+ let db_conn = server::database_worker_pool()?.get().expect("database pool");
let confectionary = auth::env_confectionary()?;
match m.subcommand() {
("list-editors", Some(_subm)) => {
diff --git a/rust/src/bin/fatcat-export.rs b/rust/src/bin/fatcat-export.rs
index 82f40048..d6764dc6 100644
--- a/rust/src/bin/fatcat-export.rs
+++ b/rust/src/bin/fatcat-export.rs
@@ -13,17 +13,15 @@ extern crate failure;
use clap::{App, Arg};
use fatcat::entity_crud::*;
-use fatcat::errors::*;
-use fatcat::identifiers::*;
-use fatcat::server::*;
+use fatcat::errors::Result;
+use fatcat::identifiers::FatcatId;
+use fatcat::server::{DbConn, self};
use fatcat_api_spec::models::*;
use std::str::FromStr;
use uuid::Uuid;
use std::thread;
-//use std::io::{Stdout,StdoutLock};
use crossbeam_channel as channel;
-//use num_cpus; TODO:
use std::io::prelude::*;
use std::io::{BufReader, BufWriter};
@@ -158,7 +156,7 @@ pub fn do_export(
entity_type: ExportEntityType,
redirects: bool,
) -> Result<()> {
- let db_pool = database_worker_pool()?;
+ let db_pool = server::database_worker_pool()?;
let buf_input = BufReader::new(std::io::stdin());
let (row_sender, row_receiver) = channel::bounded(CHANNEL_BUFFER_LEN);
let (output_sender, output_receiver) = channel::bounded(CHANNEL_BUFFER_LEN);
diff --git a/rust/src/bin/fatcatd.rs b/rust/src/bin/fatcatd.rs
index df5c390e..816ea1f0 100644
--- a/rust/src/bin/fatcatd.rs
+++ b/rust/src/bin/fatcatd.rs
@@ -6,8 +6,8 @@ extern crate slog;
extern crate hyper;
use clap::{App, Arg};
-use fatcat::errors::*;
-use fatcat::server::*;
+use fatcat::errors::Result;
+use fatcat::server;
use iron::middleware::AfterMiddleware;
use iron::modifiers::RedirectRaw;
use iron::{status, Chain, Iron, IronResult, Request, Response};
@@ -64,7 +64,7 @@ fn main() -> Result<()> {
None
};
- let mut server = create_server()?;
+ let mut server = server::create_server()?;
// metrics reporting
match env::var("FATCAT_STATSD_HOST") {