Refactor: Move extern crate definitions to lib.rs

This commit is contained in:
Mathieu David 2016-03-27 18:22:17 +02:00
parent 925939e267
commit 15d26befcc
8 changed files with 15 additions and 30 deletions

View File

@ -1,5 +1,4 @@
extern crate rustc_serialize; use rustc_serialize::json::Json;
use self::rustc_serialize::json::Json;
use std::fs::File; use std::fs::File;
use std::io::Read; use std::io::Read;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};

View File

@ -1,6 +1,4 @@
extern crate rustc_serialize; use rustc_serialize::json::{Json, ToJson};
use self::rustc_serialize::json::{Json, ToJson};
use std::path::PathBuf; use std::path::PathBuf;
use std::collections::BTreeMap; use std::collections::BTreeMap;

View File

@ -69,8 +69,11 @@
//! //!
//! Make sure to take a look at it. //! Make sure to take a look at it.
#[macro_use] extern crate rustc_serialize;
pub mod macros; extern crate handlebars;
extern crate pulldown_cmark;
#[macro_use] pub mod macros;
pub mod book; pub mod book;
mod parse; mod parse;
pub mod renderer; pub mod renderer;

View File

@ -1,6 +1,3 @@
extern crate handlebars;
extern crate rustc_serialize;
use renderer::html_handlebars::helpers; use renderer::html_handlebars::helpers;
use renderer::Renderer; use renderer::Renderer;
use book::MDBook; use book::MDBook;
@ -13,8 +10,8 @@ use std::error::Error;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use std::collections::BTreeMap; use std::collections::BTreeMap;
use self::handlebars::{Handlebars, JsonRender}; use handlebars::{Handlebars, JsonRender};
use self::rustc_serialize::json::{Json, ToJson}; use rustc_serialize::json::{Json, ToJson};
pub struct HtmlHandlebars; pub struct HtmlHandlebars;

View File

@ -1,11 +1,8 @@
extern crate handlebars;
extern crate rustc_serialize;
use std::path::Path; use std::path::Path;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use self::rustc_serialize::json::{self, ToJson}; use rustc_serialize::json::{self, ToJson};
use self::handlebars::{Handlebars, RenderError, RenderContext, Helper, Context, Renderable}; use handlebars::{Handlebars, RenderError, RenderContext, Helper, Context, Renderable};
// Handlebars helper for navigation // Handlebars helper for navigation

View File

@ -1,5 +1,3 @@
extern crate handlebars;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::fs::File; use std::fs::File;
use std::io::Read; use std::io::Read;

View File

@ -1,13 +1,9 @@
extern crate handlebars;
extern crate rustc_serialize;
extern crate pulldown_cmark;
use std::path::Path; use std::path::Path;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use self::rustc_serialize::json; use rustc_serialize::json;
use self::handlebars::{Handlebars, HelperDef, RenderError, RenderContext, Helper, Context}; use handlebars::{Handlebars, HelperDef, RenderError, RenderContext, Helper, Context};
use self::pulldown_cmark::{Parser, html, Event, Tag}; use pulldown_cmark::{Parser, html, Event, Tag};
// Handlebars helper to construct TOC // Handlebars helper to construct TOC
#[derive(Clone, Copy)] #[derive(Clone, Copy)]

View File

@ -1,9 +1,6 @@
extern crate pulldown_cmark;
pub mod fs; pub mod fs;
use self::pulldown_cmark::{Parser, html, Options, OPTION_ENABLE_TABLES, OPTION_ENABLE_FOOTNOTES}; use pulldown_cmark::{Parser, html, Options, OPTION_ENABLE_TABLES, OPTION_ENABLE_FOOTNOTES};
/// ///