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

Fix warnings in rustc 1.46.0 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AE1020
Copy link

@AE1020 AE1020 commented Sep 8, 2020

Functions that can return errors must be handled. Using the ?
operator will bubble up those errors.

The case of making a closure to pass to onload could not use
the ? in its body, so this uses expect() instead.

Also makes constant GENERIC_BOX_STYLES all caps, as the
compiler warned about this as well. While doing so, made the
string multi-line for legibility.

Values that can return errors must be handled.  Using the `?`
operator will bubble up those errors.

The case of making a closure to pass to `onload` could not use
the `?` in its body, so this uses `expect()` intead.

Also makes constant GENERIC_BOX_STYLES all caps, as the
compiler warned about this as well.  While doing so, made the
string multi-line for legibility.
@AE1020
Copy link
Author

AE1020 commented Sep 8, 2020

I don't know any Rust, so I was trying to build this example. I got some warnings and thought I'd look into what those were about. This made them go away... but...

...I can't actually test these changes... because the Make process gives me:

   Compiling (...)
   Compiling d0 v0.1.0 (/home/ae1020/Projects/draw-app)
    Finished release [optimized] target(s) in 2m 49s
[INFO]: License key is set in Cargo.toml but no LICENSE file(s) were found; Please add the LICENSE file(s) to your project directory
error: failed to validate `/home/ae1020/Projects/draw-app/target/wasm32-unknown-unknown/release/d0.wasm`

Caused by:
    Unexpected EOF (at offset 2076395)
Error: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit code: 1

I get this with wasm-pack build --dev as well, so it's not an optimization issue.

Can you still build this project with a recent Rust?

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