diff --git a/Cargo.toml b/Cargo.toml index 7c7a97e..b92470d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,11 +6,12 @@ license = "Apache-2.0/MIT" name = "console_error_panic_hook" readme = "./README.md" repository = "https://github.com/rustwasm/console_error_panic_hook" -version = "0.1.6" +edition = "2018" +version = "0.1.7" [badges] travis-ci = { repository = "rustwasm/console_error_panic_hook" } [dependencies] -cfg-if = "0.1.6" -wasm-bindgen = "0.2.37" +cfg-if = "1.0.0" +wasm-bindgen = "0.2.68" diff --git a/README.md b/README.md index 00d5070..054c8ae 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,6 @@ First, you can set the hook yourself by calling `std::panic::set_hook` in some initialization function: ```rust -extern crate console_error_panic_hook; use std::panic; fn my_init_function() { @@ -52,8 +51,6 @@ Alternatively, use `set_once` on some common code path to ensure that `std::sync::Once`. ```rust -extern crate console_error_panic_hook; - struct MyBigThing; impl MyBigThing { diff --git a/src/lib.rs b/src/lib.rs index 89945d5..fdf40cf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,7 +37,6 @@ //! some initialization function: //! //! ``` -//! extern crate console_error_panic_hook; //! use std::panic; //! //! fn my_init_function() { @@ -52,7 +51,6 @@ //! `std::sync::Once`. //! //! ``` -//! extern crate console_error_panic_hook; //! //! struct MyBigThing; //! @@ -70,14 +68,10 @@ //! Many browsers only capture the top 10 frames of a stack trace. In rust programs this is less likely to be enough. To see more frames, you can set the non-standard value `Error.stackTraceLimit`. For more information see the [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Microsoft_Extensions/Error.stackTraceLimit) or [v8 docs](https://v8.dev/docs/stack-trace-api). //! -#[macro_use] -extern crate cfg_if; - use std::panic; -cfg_if! { +cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { - extern crate wasm_bindgen; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/tests/tests.rs b/tests/tests.rs index 85d2ba6..ba09708 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1,9 +1,4 @@ -extern crate console_error_panic_hook; - -use std::fs::File; -use std::io::Read; -use std::panic; -use std::process::Command; +use std::{fs::File, io::Read, panic, process::Command}; #[test] fn cargo_readme_up_to_date() {