summaryrefslogtreecommitdiffstats
path: root/rust/src/bin/fatcat-export.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-08 23:18:32 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-08 23:20:53 -0800
commitba7d6a842cb4d61357b588fb2d3ec552c654ae64 (patch)
tree41eb8c465cd1ad0a9f70e18f49905adf7e5c3b40 /rust/src/bin/fatcat-export.rs
parenteb6fb8e5fe1efb3fbb927d13075cf5a1b33aa83e (diff)
downloadfatcat-ba7d6a842cb4d61357b588fb2d3ec552c654ae64.tar.gz
fatcat-ba7d6a842cb4d61357b588fb2d3ec552c654ae64.zip
huge refactor of rust modules/files
Taking advantage of new Rust 2018 crate/module path changes, and re-organizing things. Somewhat optimistic this could help with partial rebuild speed also.
Diffstat (limited to 'rust/src/bin/fatcat-export.rs')
-rw-r--r--rust/src/bin/fatcat-export.rs20
1 files changed, 5 insertions, 15 deletions
diff --git a/rust/src/bin/fatcat-export.rs b/rust/src/bin/fatcat-export.rs
index e1b930fc..889d7dff 100644
--- a/rust/src/bin/fatcat-export.rs
+++ b/rust/src/bin/fatcat-export.rs
@@ -2,25 +2,17 @@
#[macro_use]
extern crate clap;
-extern crate diesel;
-extern crate dotenv;
#[macro_use]
extern crate error_chain;
-extern crate fatcat;
-extern crate fatcat_api_spec;
#[macro_use]
extern crate log;
-extern crate crossbeam_channel;
-extern crate env_logger;
-extern crate num_cpus;
-extern crate serde_json;
-extern crate uuid;
use clap::{App, Arg};
-use fatcat::api_entity_crud::*;
-use fatcat::api_helpers::*;
+use fatcat::entity_crud::*;
use fatcat::errors::*;
+use fatcat::identifiers::*;
+use fatcat::server::*;
use fatcat_api_spec::models::*;
use std::str::FromStr;
use uuid::Uuid;
@@ -167,7 +159,7 @@ pub fn do_export(
entity_type: ExportEntityType,
redirects: bool,
) -> Result<()> {
- let db_pool = fatcat::database_worker_pool()?;
+ let db_pool = 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);
@@ -232,7 +224,7 @@ pub fn do_export(
Ok(())
}
-fn run() -> Result<()> {
+fn main() -> Result<()> {
let m = App::new("fatcat-export")
.version(env!("CARGO_PKG_VERSION"))
.author("Bryan Newbold <bnewbold@archive.org>")
@@ -273,5 +265,3 @@ fn run() -> Result<()> {
m.is_present("include_redirects"),
)
}
-
-quick_main!(run);