Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console_error_panic_hook::set_once()の呼び出し箇所を変更 #536

Conversation

YuukiToriyama
Copy link
Owner

変更点

  • console_error_panic_hookの設定見直し #535
  • console_error_panic_hook::set_once()の呼び出し箇所を、Parser::new()から#[wasm_bindgen(start)] fn start()に移動します。
  • #[wasm_bindgen(start)]は複数個定義することができないため、nightly.rsに定義していた#[wasm_bindgen(start)] fn start()lib.rsに移動します。

@@ -41,8 +49,6 @@ pub struct Parser {
impl Parser {
#[wasm_bindgen(constructor)]
pub fn new() -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [clippy] reported by reviewdog 🐶

warning: you should consider adding a `Default` implementation for `Parser`
  --> wasm/src/lib.rs:51:5
   |
51 | /     pub fn new() -> Self {
52 | |         Parser {
53 | |             parser: parser::Parser::default(),
54 | |         }
55 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
note: the lint level is defined here
  --> wasm/src/lib.rs:47:8
   |
47 | #[warn(clippy::new_without_default)]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try adding this
   |
49 + impl Default for Parser {
50 +     fn default() -> Self {
51 +         Self::new()
52 +     }
53 + }
   |

@YuukiToriyama YuukiToriyama marked this pull request as ready for review November 16, 2024 08:55
@YuukiToriyama YuukiToriyama merged commit 7db9e1a into feature/console-error-panic-hook/master Nov 16, 2024
8 checks passed
@YuukiToriyama YuukiToriyama deleted the feature/console-error-panic-hook/change-setting branch November 16, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant