diff options
Diffstat (limited to 'src/service/tcp.rs')
-rw-r--r-- | src/service/tcp.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/service/tcp.rs b/src/service/tcp.rs index 5f55091..87e696a 100644 --- a/src/service/tcp.rs +++ b/src/service/tcp.rs @@ -2,7 +2,7 @@ use std::fmt::Display; use serde::Deserialize; -use crate::{Check, Error, Status}; +use crate::{Error, Status}; #[derive(Debug, Clone, Deserialize)] pub struct Tcp { @@ -16,13 +16,10 @@ impl Display for Tcp { } impl Tcp { - pub async fn check(&self) -> Result<Check, Error> { + pub async fn check(&self) -> Result<Status, Error> { Ok(std::net::TcpStream::connect(&self.address) .err() - .map(|err| Check { - status: Status::Fail, - output: Some(format!("error: {err}")), - }) + .map(Into::into) .unwrap_or_default()) } } |