(&mut self)
| 547 | } |
| 548 | |
| 549 | fn read_line(&mut self) -> Result<String, EmailServiceError> { |
| 550 | let mut line = String::new(); |
| 551 | let read = self.stream.read_line(&mut line).map_err(|e| { |
| 552 | EmailServiceError::Api(format!("failed to read IMAP response line: {e}")) |
| 553 | })?; |
| 554 | |
| 555 | if read == 0 { |
| 556 | return Err(EmailServiceError::Api( |
| 557 | "unexpected EOF while reading IMAP response".to_string(), |
| 558 | )); |
| 559 | } |
| 560 | |
| 561 | while matches!(line.chars().last(), Some('\n' | '\r')) { |
| 562 | line.pop(); |
| 563 | } |
| 564 | Ok(line) |
| 565 | } |
| 566 | } |
| 567 | |
| 568 | fn connect_and_login( |
no outgoing calls
no test coverage detected