Add prelude to library crate

This commit is contained in:
Joakim Soderlund 2019-08-17 13:40:55 +00:00
parent 0df8b3aded
commit a2d140f815
3 changed files with 8 additions and 4 deletions

View file

@ -6,9 +6,7 @@ use std::io::stdout;
use std::io::Write;
use std::time::Instant;
use fimfareader::archive::Fetcher;
use fimfareader::error::Error;
use fimfareader::query::parse;
use fimfareader::prelude::*;
fn exit(error: Error) -> ! {
eprintln!("{}", error);
@ -46,7 +44,7 @@ fn main() {
println!("The archive contains {} stories.", count);
loop {
let filter = match parse(&input()) {
let filter = match query(&input()) {
Ok(filter) => filter,
Err(error) => {
println!("{}", error);

View file

@ -2,4 +2,5 @@
pub mod archive;
pub mod error;
pub mod prelude;
pub mod query;

5
src/prelude.rs Normal file
View file

@ -0,0 +1,5 @@
//! Library prelude.
pub use crate::archive::{Fetcher, Story};
pub use crate::error::{Error, Result};
pub use crate::query::parse as query;