hoodie / toastify

🍞A commandline tool that shows desktop notifications using notify-rust
Apache License 2.0
94 stars 8 forks source link

Doesn't build on rust 1.50 #9

Closed Northcode closed 2 years ago

Northcode commented 3 years ago

Tried installing with cargo install toastify

Compile error:

error[E0046]: not all trait items implemented, missing: `default`
   --> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\notify-rust-3.6.3\src\lib.rs:583:1
    |
583 | impl Default for Notification {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `default` in implementation
    |
    = help: implement the missing item: `fn default() -> Self { todo!() }`
GGLinnk commented 2 years ago

Ok, this issue is related to notify-rust 3.6.3 that have been fixed in latest revisions.

So, the real issue here is that latest toastify changes haven't been pushed to crates. And while installing this app from crates, it actually download and compiles 3.6.3 version, instead of latest notify-rust 4.5.

New issue, we can't use latest version of toastify because of a bug introduced by 444f1725a881cfc1af911772d0be69061564df80

error[E0308]: mismatched types
   --> src\main.rs:139:45
    |
139 |               if let Some(appname) = app_name {
    |  _____________________________________________^
140 | |                 notification.appname(&appname);
141 | |             }
    | |_____________^ expected enum `Result`, found `()`
    |
    = note:   expected enum `Result<(), notify_rust::error::Error>`
            found unit type `()`

For more information about this error, try `rustc --explain E0308`.
GGLinnk commented 2 years ago

Ok, I investigated a bit and I don't know why it took me so long to find out... It's like a really VERY silly problem that only happens on Windows. What it is: The main function did not return anything and so the notification was not sent in Windows...

I'm creating a pull request right now...

GGLinnk commented 2 years ago

While waiting for the pull request to be merged, you can install toastify this way:

cargo install --git https://github.com/GGLinnk/toastify.git
hoodie commented 2 years ago

sorry for the long wait. I had since published 0.5.0, but I don't have a windows machine to test on. Does the issue still persist? @Northcode @GGLinnk

Thanks

GGLinnk commented 2 years ago

@hoodie : Unfortunately it doesn't since you haven't applied change from my pull request #13

This error is still happening :

New issue, we can't use latest version of toastify because of a bug introduced by 444f172

error[E0308]: mismatched types
   --> src\main.rs:139:45
    |
139 |               if let Some(appname) = app_name {
    |  _____________________________________________^
140 | |                 notification.appname(&appname);
141 | |             }
    | |_____________^ expected enum `Result`, found `()`
    |
    = note:   expected enum `Result<(), notify_rust::error::Error>`
            found unit type `()`

For more information about this error, try `rustc --explain E0308`.

That have been fixed by my pull request.

GGLinnk commented 2 years ago

This issue have been fixed in latest commits. This issue can be closed.