• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

shnewto / ttaw / 20619631303

31 Dec 2025 01:08PM UTC coverage: 98.305% (+0.1%) from 98.199%
20619631303

push

github

web-flow
Merge pull request #16 from shnewto/dependabot/cargo/reqwest-0.13.1

Update reqwest requirement from 0.12.1 to 0.13.1

696 of 708 relevant lines covered (98.31%)

1.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

42.86
/src/error.rs
1
use std::fmt;
2

3
#[derive(Debug, Clone, PartialEq)]
4
pub enum Error {
5
    InputError(String),
6
    ProgramError(String),
7
}
8

9
impl fmt::Display for Error {
×
10
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1✔
11
        match *self {
1✔
12
            // Error::ParseError(ref s) => write!(f, "{}", s),
13
            Error::InputError(ref s) => write!(f, "{}", s),
1✔
14
            Error::ProgramError(ref s) => write!(f, "{}", s),
1✔
15
        }
16
    }
17
}
18

19
impl From<std::io::Error> for Error {
×
20
    fn from(err: std::io::Error) -> Self {
1✔
21
        Error::InputError(format!("{}", err))
2✔
22
    }
23
}
24

25
impl From<serde_json::Error> for Error {
×
26
    fn from(err: serde_json::Error) -> Self {
×
27
        Error::InputError(format!("{}", err))
×
28
    }
29
}
30

31
impl From<reqwest::Error> for Error {
×
32
    fn from(err: reqwest::Error) -> Self {
×
33
        Error::InputError(format!("{}", err))
×
34
    }
35
}
36

37
#[cfg(test)]
38
mod tests {
39
    use super::*;
40

41
    #[test]
42
    fn display() {
43
        let input = "input error".to_string();
44
        let progam = "program error".to_string();
45

46
        assert_eq!(input, format!("{}", Error::InputError(input.clone())));
47
        assert_eq!(progam, format!("{}", Error::ProgramError(progam.clone())));
48
    }
49

50
    #[test]
51
    fn io_err() {
52
        let err_str = "IO Errored!";
53
        let error = std::io::Error::new(std::io::ErrorKind::Other, err_str);
54

55
        assert_eq!(err_str.to_string(), format!("{}", Error::from(error)));
56
    }
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc