Skip to content
Snippets Groups Projects
Commit c7cfe42f authored by Maaz Ahmed's avatar Maaz Ahmed
Browse files

refactor: remove an error variant that is never used

parent 6cbb1230
No related branches found
No related tags found
1 merge request!11Release: prepare and release v0.4.0
......@@ -66,10 +66,6 @@ pub enum Error {
/// Occurs when Prometheus responds with e.g. HTTP 4xx (e.g. due to a syntax error in a PromQL query).<br>
/// Details on the error as reported by Prometheus are included in [`PrometheusError`].
Prometheus(PrometheusError),
/// Occurs when the [`Client::series`](crate::Client::series) method is called with an empty set of
/// series [`Selector`](crate::selector::Selector)s. According to the Prometheus API description at least one
/// [`Selector`](crate::selector::Selector) must be provided.
EmptySeriesSelector,
}
impl Display for Error {
......@@ -77,7 +73,6 @@ impl Display for Error {
match self {
Self::Client(e) => e.fmt(f),
Self::Prometheus(e) => e.fmt(f),
Self::EmptySeriesSelector => f.write_str("at least one series selector must be provided in order to query the series endpoint"),
}
}
}
......@@ -87,7 +82,6 @@ impl std::error::Error for Error {
match self {
Self::Client(e) => e.source(),
Self::Prometheus(p) => p.source(),
Self::EmptySeriesSelector => None,
}
}
}
......@@ -97,7 +91,6 @@ impl From<prometheus_http_query::Error> for Error {
match value {
prometheus_http_query::Error::Client(c) => Self::Client(c.into()),
prometheus_http_query::Error::Prometheus(p) => Self::Prometheus(p.into()),
prometheus_http_query::Error::EmptySeriesSelector => Self::EmptySeriesSelector,
_ => unreachable!(),
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment