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

Compiler spits out multiple warnings while compiling #9

Open
Andrea-moth opened this issue Dec 22, 2023 · 1 comment
Open

Compiler spits out multiple warnings while compiling #9

Andrea-moth opened this issue Dec 22, 2023 · 1 comment

Comments

@Andrea-moth
Copy link

warning: variant `Warning` is never constructed
 --> src/event.rs:8:5
  |
5 | pub enum AppStatus {
  |          --------- variant in this enum
...
8 |     Warning(String),
  |     ^^^^^^^
  |
  = note: `AppStatus` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
  = note: `#[warn(dead_code)]` on by default

warning: associated items `from_style` and `store_in_memory` are never used
  --> src/ui/highlight/code_theme.rs:17:12
   |
16 | impl CodeTheme {
   | -------------- associated items in this implementation
17 |     pub fn from_style(style: &Style) -> Self {
   |            ^^^^^^^^^^
...
93 |     pub fn store_in_memory(self, ctx: &Context) {
   |            ^^^^^^^^^^^^^^^

warning: methods `editable`, `removable`, `rounding`, and `size` are never used
   --> src/ui/image_upload.rs:174:12
    |
159 | impl<'a> ImageUpload<'a> {
    | ------------------------ methods in this implementation
...
174 |     pub fn editable(mut self, editable: bool) -> Self {
    |            ^^^^^^^^
...
194 |     pub fn removable(mut self, removable: bool) -> Self {
    |            ^^^^^^^^^
...
204 |     pub fn rounding(mut self, rounding: f32) -> Self {
    |            ^^^^^^^^
...
209 |     pub fn size(mut self, size: f32) -> Self {
    |            ^^^^

warning: unused `Result` that must be used
  --> src/event.rs:49:9
   |
49 |         self.inner.send_event(event);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this `Result` may be an `Err` variant, which should be handled
   = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
   |
49 |         let _ = self.inner.send_event(event);
   |         +++++++

warning: unused `TextureHandle` that must be used
  --> src/ui.rs:87:9
   |
87 |         self.textures.remove(index);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: use `let _ = ...` to ignore the resulting value
   |
87 |         let _ = self.textures.remove(index);
   |         +++++++

warning: unused `Result` that must be used
   --> src/ui.rs:232:29
    |
232 | ...                   select_system_locales();
    |                       ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
232 |                             let _ = select_system_locales();
    |                             +++++++

warning: unused `Result` that must be used
   --> src/ui.rs:244:33
    |
244 | ...                   select_locales(&[language.id]);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
244 |                                 let _ = select_locales(&[language.id]);
    |                                 +++++++

warning: `wgshadertoy` (bin "wgshadertoy") generated 7 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 52.28s

Compiling using the latest version throws these warnings, while not a detriment to the working order of the project, it will definitely harm confidence in the quality of the app and may turn people off entirely.

They should easy fixes though, as the compiler tells you how to fix most of them

@fralonra
Copy link
Owner

Thanks for pointing it out.

Could you open a PR and fix these warnings? I went over them all, some are reserved for possible future usages, eg ImageUpload::editable or AppStatus::Warning. You can either delete them or use #[rustfmt::skip].

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

No branches or pull requests

2 participants