Skip to content

Commit 1d443ec

Browse files
authored
Don't need extern crate with Rust 2018+ (parcel-bundler#4)
1 parent 4c9f3a1 commit 1d443ec

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/lib.rs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
extern crate serde;
2-
extern crate serde_bytes;
3-
extern crate cssparser;
4-
extern crate selectors;
5-
extern crate itertools;
6-
extern crate smallvec;
7-
extern crate bitflags;
8-
91
#[cfg(target_os = "macos")]
102
#[global_allocator]
113
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
@@ -29,7 +21,6 @@ use properties::VendorPrefix;
2921
use properties::prefixes::{Browsers, Feature};
3022
use declaration::DeclarationHandler;
3123
use std::collections::HashMap;
32-
3324
use parser::TopLevelRuleParser;
3425

3526
// ---------------------------------------------
@@ -52,10 +43,7 @@ pub fn transform(config_val: JsValue) -> Result<JsValue, JsValue> {
5243
// ---------------------------------------------
5344

5445
#[cfg(not(target_arch = "wasm32"))]
55-
extern crate napi;
56-
#[cfg(not(target_arch = "wasm32"))]
57-
#[macro_use]
58-
extern crate napi_derive;
46+
use napi_derive::{js_function, module_exports};
5947
#[cfg(not(target_arch = "wasm32"))]
6048
use napi::{CallContext, JsObject, JsBuffer};
6149

@@ -214,9 +202,8 @@ fn compile(code: &str, minify: bool, targets: Option<Browsers>) -> Result<String
214202

215203
#[cfg(test)]
216204
mod tests {
217-
use super::*;
218-
extern crate indoc;
219-
use self::indoc::indoc;
205+
use super::*;
206+
use indoc::indoc;
220207

221208
fn test(source: &str, expected: &str) {
222209
let res = compile(source, false, None).unwrap();

0 commit comments

Comments
 (0)