Skip to content

Commit

Permalink
Merge pull request #59 from LostInBrittany/updating-postgresql-version
Browse files Browse the repository at this point in the history
Fix #58 - Updating PsotgreSQL version
  • Loading branch information
FlorentinDUBOIS committed Apr 22, 2024
2 parents 66916b4 + 2293e54 commit 1c289a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/v4/addon_provider/postgresql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::{

#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("failed to parse version from '{0}', available versions are 13, 12, 11 and 10")]
#[error("failed to parse version from '{0}', available versions are 15, 14, 13, 12 and 11")]
ParseVersion(String),
#[error("failed to get information about addon provider '{0}', {1}")]
Get(AddonProviderId, ClientError),
Expand All @@ -41,23 +41,23 @@ pub enum Error {
#[serde(untagged)]
#[repr(i32)]
pub enum Version {
V15 = 15,
V14 = 14,
V13 = 13,
V12 = 12,
V11 = 11,
V10 = 10,
}

impl FromStr for Version {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(match s {
"15" => Self::V15,
"14" => Self::V14,
"13" => Self::V13,
"12" => Self::V12,
"11" => Self::V11,
"10" => Self::V10,
_ => {
return Err(Error::ParseVersion(s.to_owned()));
}
Expand All @@ -83,11 +83,11 @@ impl Into<String> for Version {
impl Display for Version {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
match self {
Self::V15 => write!(f, "15"),
Self::V14 => write!(f, "14"),
Self::V13 => write!(f, "13"),
Self::V12 => write!(f, "12"),
Self::V11 => write!(f, "11"),
Self::V10 => write!(f, "10"),
}
}
}
Expand Down

0 comments on commit 1c289a0

Please sign in to comment.