pimalaya / himalaya

CLI to manage emails
https://pimalaya.org
MIT License
3.17k stars 95 forks source link

bumping lettre to 0.10.0-rc.7 #391

Closed TornaxO7 closed 2 years ago

TornaxO7 commented 2 years ago

Whoops, I forgot to do that

soywod commented 2 years ago

It could be the reason of the failed nix build btw

soywod commented 2 years ago

This time, the nix build is OK but not the tests :rofl: could your merge origin/development and push to see?

TornaxO7 commented 2 years ago

Oh no, I'm getting some errors in the cli module.

TornaxO7 commented 2 years ago

What the o.O

TornaxO7 commented 2 years ago

I'm very irrated now because it looks like that Envelopes used to be a trait but now it's a struct?

TornaxO7 commented 2 years ago

I'm getting the same error if I switch to the development branch and do

cargo test --all-features --all

Output:

error[E0432]: unresolved import `crate::msg::Envelopes`
  --> cli/src/mbox/mbox_handlers.rs:41:15
   |
41 |         msg::{Envelopes, Msg},
   |               ^^^^^^^^^
   |               |
   |               no `Envelopes` in `msg`
   |               help: a similar name exists in the module: `envelopes`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `himalaya` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

@soywod

soywod commented 2 years ago

Tests are broken on development since my last commit, my bad! I'm fixing it, I let you know when you can pull again.

I'm very irrated now because it looks like that Envelopes used to be a trait but now it's a struct?

It is because of #340, the backend trait had this member:

fn get_envelopes(&mut self, mbox: &str, page_size: usize, page: usize) -> Result<Box<dyn Envelopes>>;

But Envelopes expected the trait Printable:

pub trait Envelopes: fmt::Debug + erased_serde::Serialize + PrintTable + any::Any;

which is a big problem: the Printable trait is used to print tables, this should belong to the cli module and not the lib. So I started to replace Envelopes and Mboxes traits by structs. I do not know if my explanations are clear enough, but to summarize it was a necessary step to move the Backend trait to the lib module.

soywod commented 2 years ago

I just fixed tests on development, you can pull again then we can merge this PR.

TornaxO7 commented 2 years ago

Done! The tests should pass now (cargo test --all-features --all run succesfully on my machine!)

TornaxO7 commented 2 years ago

Yay!