Skip to content

Commit

Permalink
Remove extern crate in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lnicola committed Jul 25, 2019
1 parent 40cb70b commit 403fb40
Showing 1 changed file with 16 additions and 68 deletions.
84 changes: 16 additions & 68 deletions src/lib.rs
Expand Up @@ -158,11 +158,8 @@ pub fn clean_text(src: &str) -> String {
/// a particular value:
///
/// ```should_panic
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::hashset;
///
/// # fn main() {
/// Builder::default()
Expand All @@ -174,11 +171,8 @@ pub fn clean_text(src: &str) -> String {
/// This, however, is perfectly valid:
///
/// ```
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::hashset;
///
/// # fn main() {
/// Builder::default()
Expand All @@ -198,11 +192,8 @@ pub fn clean_text(src: &str) -> String {
/// This will panic:
///
/// ```should_panic
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::{hashmap, hashset};
///
/// # fn main() {
/// Builder::default()
Expand All @@ -215,11 +206,8 @@ pub fn clean_text(src: &str) -> String {
/// This, however, is perfectly valid:
///
/// ```
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::{hashmap, hashset};
///
/// # fn main() {
/// Builder::default()
Expand All @@ -239,11 +227,8 @@ pub fn clean_text(src: &str) -> String {
/// [`tags`] by default:
///
/// ```should_panic
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::hashset;
///
/// # fn main() {
/// Builder::default()
Expand All @@ -255,11 +240,8 @@ pub fn clean_text(src: &str) -> String {
/// This, however, is valid:
///
/// ```
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::hashset;
///
/// # fn main() {
/// Builder::default()
Expand Down Expand Up @@ -402,11 +384,8 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::hashset;
///
/// # fn main() {
/// let tags = hashset!["my-tag"];
Expand Down Expand Up @@ -486,11 +465,8 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::hashset;
///
/// # fn main() {
/// let tag_blacklist = hashset!["script", "style"];
Expand Down Expand Up @@ -532,11 +508,8 @@ impl<'a> Builder<'a> {
/// Does nothing if the tags aren't blacklisted.
///
/// # Examples
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::hashset;
///
/// # fn main() {
/// let tag_blacklist = hashset!["script"];
Expand Down Expand Up @@ -573,11 +546,8 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::{hashmap, hashset};
///
/// # fn main() {
/// let tags = hashset!["my-tag"];
Expand Down Expand Up @@ -691,11 +661,8 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::{hashmap, hashset};
///
/// # fn main() {
/// let tags = hashset!["my-tag"];
Expand Down Expand Up @@ -783,11 +750,8 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::hashset;
///
/// # fn main() {
/// let attributes = hashset!["data-val"];
Expand Down Expand Up @@ -854,11 +818,8 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::hashset;
///
/// # fn main() {
/// let url_schemes = hashset![
Expand Down Expand Up @@ -1023,7 +984,6 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// # extern crate ammonia;
/// use ammonia::{Builder, UrlRelative};
/// use std::borrow::Cow;
/// fn test(a: &str) -> Option<Cow<str>> { None }
Expand Down Expand Up @@ -1102,11 +1062,8 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::{hashmap, hashset};
///
/// # fn main() {
/// let allowed_classes = hashmap![
Expand Down Expand Up @@ -1217,11 +1174,8 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// #[macro_use]
/// extern crate maplit;
/// # extern crate ammonia;
///
/// use ammonia::Builder;
/// use maplit::hashset;
///
/// # fn main() {
/// let attributes = hashset!["id"];
Expand All @@ -1246,7 +1200,6 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// # extern crate ammonia;
/// use ammonia::{Builder, Url, UrlRelative};
/// # use std::error::Error;
///
Expand All @@ -1273,7 +1226,6 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// # extern crate ammonia;
/// use ammonia::{Builder, Url, UrlRelative};
/// # use std::error::Error;
///
Expand Down Expand Up @@ -1304,7 +1256,6 @@ impl<'a> Builder<'a> {
///
/// # Examples
///
/// # extern crate ammonia;
/// use ammonia::Builder;
/// # use std::error::Error;
///
Expand Down Expand Up @@ -1656,7 +1607,6 @@ fn is_url_relative(url: &str) -> bool {
/// If it returns `Some(string)`, then that one gets used.
/// Otherwise, it will remove the attribute (like `Deny` does).
///
/// # extern crate ammonia;
/// use std::borrow::Cow;
/// fn is_absolute_path(url: &str) -> bool {
/// let u = url.as_bytes();
Expand Down Expand Up @@ -1869,10 +1819,8 @@ impl Document {
///
/// # Examples
///
/// # extern crate ammonia;
/// extern crate html5ever;
///
/// use ammonia::Builder;
/// use maplit::hashset;
/// use html5ever::serialize::{serialize, SerializeOpts};
///
/// # use std::error::Error;
Expand Down

0 comments on commit 403fb40

Please sign in to comment.