clean mbox lib module

This commit is contained in:
Clément DOUIN
2022-06-27 20:55:22 +02:00
parent 1e4dc0cb5a
commit 9bcd659af2
3 changed files with 15 additions and 3 deletions
+4
View File
@@ -1,3 +1,7 @@
//! Mailbox module.
//!
//! This module contains the representation of the mailbox.
use serde::Serialize; use serde::Serialize;
use std::fmt; use std::fmt;
+7 -3
View File
@@ -1,5 +1,9 @@
//! Mailboxes module.
//!
//! This module contains the representation of the mailboxes.
use serde::Serialize; use serde::Serialize;
use std::ops::{Deref, DerefMut}; use std::ops;
use super::Mbox; use super::Mbox;
@@ -10,7 +14,7 @@ pub struct Mboxes {
pub mboxes: Vec<Mbox>, pub mboxes: Vec<Mbox>,
} }
impl Deref for Mboxes { impl ops::Deref for Mboxes {
type Target = Vec<Mbox>; type Target = Vec<Mbox>;
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
@@ -18,7 +22,7 @@ impl Deref for Mboxes {
} }
} }
impl DerefMut for Mboxes { impl ops::DerefMut for Mboxes {
fn deref_mut(&mut self) -> &mut Self::Target { fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.mboxes &mut self.mboxes
} }
+4
View File
@@ -1,3 +1,7 @@
//! Mailbox module.
//!
//! This module contains everything related to mailboxes.
mod mbox; mod mbox;
pub use mbox::*; pub use mbox::*;