duesee / imap-codec

Rock-solid and complete codec for IMAP
Apache License 2.0
38 stars 14 forks source link

docs: Improve code examples #397

Closed coalooball closed 10 months ago

coalooball commented 10 months ago

See https://github.com/duesee/imap-codec/issues/393

coalooball commented 10 months ago

Also see https://github.com/duesee/imap-codec/issues/394

duesee commented 10 months ago

Hehe, I was just about to merge because I overlooked https://github.com/duesee/imap-codec/pull/397/files#diff-cfcb5beb66760b7d974ea036d027714665a3c57f72ca940df6dcdd3e138a1d69R24-R32 :D Good that we have a CI :-) I think it should be enough to remove this? Same with https://github.com/duesee/imap-codec/pull/397/files#diff-cfcb5beb66760b7d974ea036d027714665a3c57f72ca940df6dcdd3e138a1d69R65-R72? Maybe also toss a cargo +nightly fmt just in case.

coalooball commented 10 months ago

Whoops (○´・д・)ノ my bad, I didn't use cargo t to test. Thought the code below was a no-go:

//! # use imap_codec::{
//! # encode::Encoder,
//! # imap_types::{
//! # core::Text,
//! # response::{Code, Greeting, GreetingKind},
//! # },
//! # GreetingCodec,
//! # };

I originally wanted to write a separate section to specifically explain how to use imap-types, but I thought it would be better to write it as a comment in the code, so I deleted your previous code. Now, cargo t aced the test. The CI is my lifesaver!

coveralls commented 10 months ago

Pull Request Test Coverage Report for Build 7130307555


Totals Coverage Status
Change from base Build 7129545557: 0.0%
Covered Lines: 8728
Relevant Lines: 9441

💛 - Coveralls
duesee commented 10 months ago

Thanks! :-)

duesee commented 10 months ago

Oh, btw @coalooball: Was this your first PR on GitHub? I feel honored! :D Congratz 🎉

coalooball commented 10 months ago

Haha, this is my first PR, and I'm pretty excited about it. Thank you for your blessings, @duesee! I hope I can become as awesome as you, contributing real-code PRs to imap-codec.