Skip to content

Commit 09c534f

Browse files
committed
Remove 'extern crate' in source files
1 parent 44dfcdd commit 09c534f

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

src/main.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![forbid(unsafe_code)]
2-
extern crate env_logger;
3-
#[macro_use]
4-
extern crate lazy_static;
5-
#[macro_use]
6-
extern crate log;
72

83
/**
94
If this is set to `false`, then code that automatically deletes stuff *won't*.
@@ -23,6 +18,7 @@ mod file_assoc;
2318
#[cfg(not(windows))]
2419
mod file_assoc {}
2520

21+
use log::{debug, error, info};
2622
use serde::{Deserialize, Serialize};
2723
use std::ffi::OsString;
2824
use std::fs;

src/manifest.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/*!
22
This module is concerned with how `rust-script` extracts the manfiest from a script file.
33
*/
4-
extern crate pulldown_cmark;
5-
extern crate regex;
4+
use regex;
65

76
use self::regex::Regex;
87
use std::collections::HashMap;
@@ -12,6 +11,8 @@ use crate::consts;
1211
use crate::error::{MainError, MainResult};
1312
use crate::templates;
1413
use crate::Input;
14+
use lazy_static::lazy_static;
15+
use log::{error, info};
1516
use std::ffi::OsString;
1617

1718
lazy_static! {
@@ -667,7 +668,7 @@ fn find_code_block_manifest(s: &str) -> Option<(Manifest, &str)> {
667668
Extracts the first `Cargo` fenced code block from a chunk of Markdown.
668669
*/
669670
fn scrape_markdown_manifest(content: &str) -> Option<String> {
670-
use self::pulldown_cmark::{CodeBlockKind, Event, Options, Parser, Tag};
671+
use pulldown_cmark::{CodeBlockKind, Event, Options, Parser, Tag};
671672

672673
// To match librustdoc/html/markdown.rs, opts.
673674
let exts = Options::ENABLE_TABLES | Options::ENABLE_FOOTNOTES;

src/platform.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub fn cache_dir() -> Result<PathBuf, MainError> {
3838

3939
#[cfg(test)]
4040
pub fn cache_dir() -> Result<PathBuf, MainError> {
41+
use lazy_static::lazy_static;
4142
lazy_static! {
4243
static ref TEMP_DIR: tempfile::TempDir = tempfile::TempDir::new().unwrap();
4344
}
@@ -66,8 +67,6 @@ pub fn templates_dir() -> Result<PathBuf, MainError> {
6667

6768
#[cfg(unix)]
6869
mod inner {
69-
extern crate atty;
70-
7170
pub use super::*;
7271

7372
/**

src/templates.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This module contains code related to template support.
44
use crate::consts;
55
use crate::error::{MainError, MainResult};
66
use crate::platform;
7+
use lazy_static::lazy_static;
78
use regex::Regex;
89
use std::borrow::Cow;
910
use std::collections::HashMap;

src/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*!
22
This module just contains other random implementation stuff.
33
*/
4+
use log::error;
45
use std::error::Error;
56
use std::marker::PhantomData;
67

0 commit comments

Comments
 (0)