Commit 1b1b4fee authored by Ben Boeckel's avatar Ben Boeckel
Browse files

rustversion: remove dependency

No longer necessary now that 1.39 is our minimum.
parent 5ebcb31d
......@@ -19,7 +19,6 @@ itertools = "~0.8"
log = "~0.4"
percent-encoding = "^2.0"
reqwest = { version = "~0.10", features = ["blocking", "json"] }
rustversion = "^1.0"
thiserror = "^1.0.2"
url = "2.1"
......
......@@ -4,7 +4,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[rustversion::since(1.38)]
use std::any;
use std::borrow::Borrow;
use std::fmt::{self, Debug, Display};
......@@ -123,11 +122,11 @@ pub enum GitlabError {
GraphQL { message: Vec<graphql_client::Error> },
#[error("no response from gitlab")]
NoResponse {},
#[error("could not parse {} data from JSON: {}", typename.unwrap_or("<unknown>"), source)]
#[error("could not parse {} data from JSON: {}", typename, source)]
DataType {
#[source]
source: serde_json::Error,
typename: Option<&'static str>,
typename: &'static str,
},
/// This is here to force `_` matching right now.
///
......@@ -178,19 +177,10 @@ impl GitlabError {
GitlabError::NoResponse {}
}
#[rustversion::since(1.38)]
fn data_type<T>(source: serde_json::Error) -> Self {
GitlabError::DataType {
source,
typename: Some(any::type_name::<T>()),
}
}
#[rustversion::before(1.38)]
fn data_type<T>(source: serde_json::Error) -> Self {
GitlabError::DataType {
source,
typename: None,
typename: any::type_name::<T>(),
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment