Skip to content

Commit e312347

Browse files
committed
(nit) Cargo fmt
1 parent beb41d2 commit e312347

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

examples/rustls.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
extern crate imap;
22
extern crate rustls_connector;
33

4-
use std::{
5-
env,
6-
error::Error,
7-
net::TcpStream,
8-
};
4+
use std::{env, error::Error, net::TcpStream};
95

106
use dotenv::dotenv;
117
use rustls_connector::RustlsConnector;
128

13-
149
fn main() -> Result<(), Box<dyn Error>> {
1510
// Read config from environment or .env file
1611
dotenv().ok();
@@ -26,7 +21,12 @@ fn main() -> Result<(), Box<dyn Error>> {
2621
Ok(())
2722
}
2823

29-
fn fetch_inbox_top(host: String, user: String, password: String, port: u16) -> Result<Option<String>, Box<dyn Error>> {
24+
fn fetch_inbox_top(
25+
host: String,
26+
user: String,
27+
password: String,
28+
port: u16,
29+
) -> Result<Option<String>, Box<dyn Error>> {
3030
// Setup Rustls TcpStream
3131
let stream = TcpStream::connect((host.as_ref(), port))?;
3232
let tls = RustlsConnector::default();
@@ -38,9 +38,7 @@ fn fetch_inbox_top(host: String, user: String, password: String, port: u16) -> R
3838

3939
// the client we have here is unauthenticated.
4040
// to do anything useful with the e-mails, we need to log in
41-
let mut imap_session = client
42-
.login(&user, &password)
43-
.map_err(|e| e.0)?;
41+
let mut imap_session = client.login(&user, &password).map_err(|e| e.0)?;
4442

4543
// we want to fetch the first email in the INBOX mailbox
4644
imap_session.select("INBOX")?;

0 commit comments

Comments
 (0)