From 39b51851fba1311b4ae4b35a652b869b2fed070e Mon Sep 17 00:00:00 2001 From: SmiteWindows Date: Wed, 16 Sep 2020 09:48:38 +0800 Subject: [PATCH 1/4] update dependencies --- Cargo.toml | 7 ++++--- src/lib.rs | 8 +------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7c7a97e..65ea40b 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 = "0.1.10" +wasm-bindgen = "0.2.68" 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] From ff7432edce0aec1308a29f1cb8e556a70c0048ae Mon Sep 17 00:00:00 2001 From: SmiteWindows Date: Wed, 16 Sep 2020 09:52:06 +0800 Subject: [PATCH 2/4] fix readme --- README.md | 3 --- 1 file changed, 3 deletions(-) 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 { From bcc294c299944f50306b4ae39a3da05d7550a3ba Mon Sep 17 00:00:00 2001 From: SmiteWindows Date: Wed, 16 Sep 2020 10:10:07 +0800 Subject: [PATCH 3/4] fix --- tests/tests.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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() { From 2a524d5591b9e87f06a2e9f3df3f37d4e506d740 Mon Sep 17 00:00:00 2001 From: Smite Rust Date: Tue, 13 Oct 2020 20:23:59 +0800 Subject: [PATCH 4/4] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 65ea40b..b92470d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,5 +13,5 @@ version = "0.1.7" travis-ci = { repository = "rustwasm/console_error_panic_hook" } [dependencies] -cfg-if = "0.1.10" +cfg-if = "1.0.0" wasm-bindgen = "0.2.68"