Skip to content

Commit d5ae7bb

Browse files
HocdocBernhard Berger
and
Bernhard Berger
authored
Remove unneeded extern crates
Closes GH-28. Co-authored-by: Bernhard Berger <[email protected]>
1 parent 34ea284 commit d5ae7bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3
-100
lines changed

Untitled.txt

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ micromark.js: `atLineEnding` in html (text) should always eat arbitrary whitespa
66
```rs
77
// ---------------------
88
// Useful helper:
9-
extern crate std;
109
use std::println;
1110
use alloc::string::String;
1211

benches/bench.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#[macro_use]
2-
extern crate criterion;
3-
use criterion::{BenchmarkId, Criterion};
1+
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
42
use std::fs;
53

64
fn readme(c: &mut Criterion) {

build.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate reqwest;
21
use regex::Regex;
32
use std::fs;
43

@@ -67,7 +66,6 @@ async fn commonmark() {
6766
// > 👉 **Important**: this module is generated by `build.rs`.
6867
// > It is generate from the latest CommonMark website.
6968
70-
extern crate markdown;
7169
use markdown::{{to_html_with_options, CompileOptions, Options}};
7270
use pretty_assertions::assert_eq;
7371

examples/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate markdown;
2-
31
fn main() -> Result<(), String> {
42
// Turn on debugging.
53
// You can show it with `RUST_LOG=debug cargo run --example lib`

fuzz/fuzz_targets/markdown.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
#![no_main]
22
use libfuzzer_sys::fuzz_target;
3-
extern crate markdown;
43

54
fuzz_target!(|data: &[u8]| {
65
if let Ok(s) = std::str::from_utf8(data) {
76
let _ = markdown::to_html(s);
8-
let _ = markdown::to_html_with_options(
9-
s,
10-
&markdown::Options::gfm()
11-
);
7+
let _ = markdown::to_html_with_options(s, &markdown::Options::gfm());
128
let _ = markdown::to_mdast(s, &markdown::ParseOptions::default());
139
let _ = markdown::to_mdast(s, &markdown::ParseOptions::gfm());
1410
}

readme.md

-6

src/configuration.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,6 @@ impl Options {
12361236

12371237
#[cfg(test)]
12381238
mod tests {
1239-
extern crate std;
12401239
use super::*;
12411240
use crate::util::mdx::Signal;
12421241
use alloc::format;

src/util/line_ending.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate alloc;
2-
31
use alloc::{str::FromStr, string::String};
42

53
/// Type of line endings in markdown.
@@ -82,7 +80,6 @@ impl FromStr for LineEnding {
8280

8381
#[cfg(test)]
8482
mod tests {
85-
extern crate std;
8683
use super::*;
8784

8885
#[test]

src/util/mdx.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate alloc;
2-
31
use alloc::string::String;
42

53
/// Signal used as feedback when parsing MDX ESM/expressions.
@@ -89,7 +87,6 @@ pub type ExpressionParse = dyn Fn(&str, &ExpressionKind) -> Signal;
8987

9088
#[cfg(test)]
9189
mod tests {
92-
extern crate std;
9390
use super::*;
9491
use alloc::boxed::Box;
9592

tests/attention.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Emphasis, Node, Paragraph, Root, Strong, Text},
43
to_html, to_html_with_options, to_mdast,

tests/autolink.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Link, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/block_quote.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{BlockQuote, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/character_escape.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/character_reference.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/code_fenced.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Code, Node, Root},
43
to_html, to_html_with_options, to_mdast,

tests/code_indented.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Code, Node, Root},
43
to_html, to_html_with_options, to_mdast,

tests/code_text.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{InlineCode, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/commonmark.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// > 👉 **Important**: this module is generated by `build.rs`.
44
// > It is generate from the latest CommonMark website.
55

6-
extern crate markdown;
76
use markdown::{to_html_with_options, CompileOptions, Options};
87
use pretty_assertions::assert_eq;
98

tests/definition.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Definition, Node, Root},
43
to_html, to_html_with_options, to_mdast,

tests/frontmatter.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Node, Root, Toml, Yaml},
43
to_html, to_html_with_options, to_mdast,

tests/fuzz.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{mdast, to_html, to_html_with_options, to_mdast, Options};
32
use pretty_assertions::assert_eq;
43

tests/gfm_autolink_literal.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Link, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/gfm_footnote.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{FootnoteDefinition, FootnoteReference, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/gfm_strikethrough.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Delete, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/gfm_table.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{AlignKind, InlineCode, Node, Root, Table, TableCell, TableRow, Text},
43
to_html, to_html_with_options, to_mdast,

tests/gfm_tagfilter.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{to_html_with_options, CompileOptions, Options};
32
use pretty_assertions::assert_eq;
43

tests/gfm_task_list_item.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{List, ListItem, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/hard_break_escape.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Break, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/hard_break_trailing.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Break, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/heading_atx.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Heading, Node, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/heading_setext.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Heading, Node, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/html_flow.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Html, Node, Root},
43
to_html, to_html_with_options, to_mdast,

tests/html_text.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Html, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/image.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Definition, Image, ImageReference, Node, Paragraph, ReferenceKind, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/link_reference.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Definition, LinkReference, Node, Paragraph, ReferenceKind, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/link_resource.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Link, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/list.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{List, ListItem, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/math_flow.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Math, Node, Root},
43
to_html, to_html_with_options, to_mdast,

tests/math_text.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{InlineMath, Node, Paragraph, Root, Text},
43
to_html, to_html_with_options, to_mdast,

tests/mdx_esm.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
mod test_utils;
32
use markdown::{
43
mdast::{MdxjsEsm, Node, Root},

tests/mdx_expression_flow.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
mod test_utils;
32
use markdown::{
43
mdast::{MdxFlowExpression, Node, Root},

tests/mdx_expression_text.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
mod test_utils;
32
use markdown::{
43
mdast::{MdxTextExpression, Node, Paragraph, Root, Text},

tests/mdx_jsx_flow.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{List, ListItem, MdxJsxFlowElement, Node, Paragraph, Root, Text},
43
to_html_with_options, to_mdast,

tests/mdx_jsx_text.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
mod test_utils;
32
use markdown::{
43
mdast::{

tests/mdx_swc.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
mod test_utils;
32
use markdown::{to_html_with_options, Constructs, Options, ParseOptions};
43
use pretty_assertions::assert_eq;

tests/misc_bom.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::to_html;
32
use pretty_assertions::assert_eq;
43

tests/misc_dangerous_html.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{to_html, to_html_with_options, CompileOptions, Options};
32
use pretty_assertions::assert_eq;
43

tests/misc_dangerous_protocol.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::to_html;
32
use pretty_assertions::assert_eq;
43

tests/misc_default_line_ending.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{to_html, to_html_with_options, CompileOptions, LineEnding, Options};
32
use pretty_assertions::assert_eq;
43

tests/misc_line_ending.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{to_html, to_html_with_options, CompileOptions, Options};
32
use pretty_assertions::assert_eq;
43

tests/misc_soft_break.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::to_html;
32
use pretty_assertions::assert_eq;
43

tests/misc_tabs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{to_html, to_html_with_options, CompileOptions, Options};
32
use pretty_assertions::assert_eq;
43

tests/misc_url.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::to_html;
32
use pretty_assertions::assert_eq;
43

tests/misc_zero.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::to_html;
32
use pretty_assertions::assert_eq;
43

tests/test_utils/hast.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// ^-- To do: externalize.
77

88
extern crate alloc;
9-
extern crate markdown;
109
use alloc::{
1110
fmt,
1211
string::{String, ToString},

tests/test_utils/hast_util_to_swc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
//! TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2727
//! SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2828

29-
extern crate swc_common;
30-
extern crate swc_ecma_ast;
3129
use crate::test_utils::{
3230
hast,
3331
swc::{parse_esm_to_tree, parse_expression_to_tree},

tests/test_utils/mdx_plugin_recma_document.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! Port of <https://github.com/mdx-js/mdx/blob/main/packages/mdx/lib/plugin/recma-document.js>,
44
//! by the same author.
55

6-
extern crate swc_ecma_ast;
76
use crate::test_utils::{
87
hast_util_to_swc::Program,
98
swc_utils::{bytepos_to_point, prefix_error_with_point, span_to_position},

tests/test_utils/mdx_plugin_recma_jsx_rewrite.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//! Port of <https://github.com/mdx-js/mdx/blob/main/packages/mdx/lib/plugin/recma-jsx-rewrite.js>,
44
//! by the same author.
55

6-
extern crate swc_common;
7-
extern crate swc_ecma_ast;
86
use crate::test_utils::{
97
hast_util_to_swc::Program,
108
swc_utils::{

tests/test_utils/swc.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
//! Bridge between `markdown-rs` and SWC.
2-
extern crate markdown;
3-
extern crate swc_common;
4-
extern crate swc_ecma_ast;
5-
extern crate swc_ecma_parser;
2+
63
use crate::test_utils::swc_utils::{bytepos_to_point, prefix_error_with_point, RewriteContext};
74
use markdown::{mdast::Stop, unist::Point, Location, MdxExpressionKind, MdxSignal};
85
use swc_common::{

tests/text.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::to_html;
32
use pretty_assertions::assert_eq;
43

tests/thematic_break.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate markdown;
21
use markdown::{
32
mdast::{Node, Root, ThematicBreak},
43
to_html, to_html_with_options, to_mdast,

0 commit comments

Comments
 (0)