Commit 19357a82 authored by Ben Boeckel's avatar Ben Boeckel

crates: add a module for importing crates

parent 7cb21fad
......@@ -6,8 +6,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern crate serde_json;
use self::serde_json::Value;
use crates::serde_json::Value;
error_chain! {
errors {
......
......@@ -6,22 +6,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern crate itertools;
use self::itertools::Itertools;
extern crate reqwest;
use self::reqwest::{Client, Method, RequestBuilder, Url};
extern crate serde;
use self::serde::{Deserialize, Deserializer, Serializer};
use self::serde::de::Error as SerdeError;
use self::serde::de::Unexpected;
use self::serde::ser::Serialize;
extern crate serde_json;
extern crate url;
use self::url::percent_encoding::{PATH_SEGMENT_ENCODE_SET, percent_encode};
use crates::itertools::Itertools;
use crates::reqwest::{Client, Method, RequestBuilder, Url};
use crates::serde::{Deserialize, Deserializer, Serializer};
use crates::serde::de::Error as SerdeError;
use crates::serde::de::Unexpected;
use crates::serde::ser::Serialize;
use crates::serde_json;
use crates::url::percent_encoding::{PATH_SEGMENT_ENCODE_SET, percent_encode};
use error::*;
use types::*;
......
......@@ -13,12 +13,9 @@
//! Gitlab does not have consistent structures for its hooks, so they often change from
//! version to version.
extern crate serde;
use self::serde::{Deserialize, Deserializer};
use self::serde::de::{Error, Unexpected};
extern crate serde_json;
use self::serde_json::Value;
use crates::serde::{Deserialize, Deserializer};
use crates::serde::de::{Error, Unexpected};
use crates::serde_json::{self, Value};
use systemhooks::SystemHook;
use webhooks::WebHook;
......
......@@ -22,6 +22,21 @@ extern crate log;
#[macro_use]
extern crate serde_derive;
mod crates {
// public
pub extern crate chrono;
// pub extern crate error_chain;
pub extern crate serde;
pub extern crate serde_json;
// private
pub extern crate hyper;
pub extern crate itertools;
pub extern crate log;
pub extern crate reqwest;
pub extern crate url;
}
mod error;
#[macro_use]
mod macros;
......
......@@ -14,15 +14,10 @@
//! Gitlab does not have consistent structures for its hooks, so they often change from
//! version to version.
extern crate chrono;
use self::chrono::{DateTime, UTC};
extern crate serde;
use self::serde::{Deserialize, Deserializer, Serialize, Serializer};
use self::serde::de::{Error, Unexpected};
extern crate serde_json;
use self::serde_json::Value;
use crates::chrono::{DateTime, UTC};
use crates::serde::{Deserialize, Deserializer, Serialize, Serializer};
use crates::serde::de::{Error, Unexpected};
use crates::serde_json::{self, Value};
use types::{AccessLevel, GroupId, ObjectId, ProjectId, SshKeyId, UserId};
use webhooks::{CommitHookAttrs, ProjectHookAttrs};
......
......@@ -6,14 +6,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern crate chrono;
use self::chrono::{TimeZone, UTC};
extern crate serde;
use self::serde::Deserialize;
extern crate serde_json;
use self::serde_json::from_reader;
use crates::chrono::{TimeZone, UTC};
use crates::serde::Deserialize;
use crates::serde_json::from_reader;
use types::*;
......
......@@ -14,15 +14,10 @@
//! problems when the types and names change inside of those. If found, issues should be filed
//! upstream.
extern crate chrono;
use self::chrono::{DateTime, NaiveDate, UTC};
extern crate serde;
use self::serde::{Deserialize, Deserializer, Serialize, Serializer};
use self::serde::de::{Error, Unexpected};
extern crate serde_json;
use self::serde_json::Value;
use crates::chrono::{DateTime, NaiveDate, UTC};
use crates::serde::{Deserialize, Deserializer, Serialize, Serializer};
use crates::serde::de::{Error, Unexpected};
use crates::serde_json::{self, Value};
use std::fmt::{self, Display, Formatter};
......
......@@ -13,15 +13,10 @@
//! Gitlab does not have consistent structures for its hooks, so they often change from
//! version to version.
extern crate chrono;
use self::chrono::{DateTime, NaiveDate, TimeZone, UTC};
extern crate serde;
use self::serde::{Deserialize, Deserializer, Serialize, Serializer};
use self::serde::de::{Error, Unexpected};
extern crate serde_json;
use self::serde_json::Value;
use crates::chrono::{DateTime, NaiveDate, TimeZone, UTC};
use crates::serde::{Deserialize, Deserializer, Serialize, Serializer};
use crates::serde::de::{Error, Unexpected};
use crates::serde_json::{self, Value};
use types::{BuildId, IssueId, IssueState, MergeRequestId, MergeRequestState, MergeStatus,
MilestoneId, NoteId, NoteType, NoteableId, ObjectId, ProjectId, SnippetId, UserId};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment