From 5f34e97efb8d67d7b3763d53d747d06661bde558 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 24 Apr 2019 09:44:03 +0200 Subject: types: Add "new" derive --- librepology/src/v1/types/category.rs | 2 +- librepology/src/v1/types/download.rs | 2 +- librepology/src/v1/types/effname.rs | 2 +- librepology/src/v1/types/license.rs | 2 +- librepology/src/v1/types/maintainer.rs | 2 +- librepology/src/v1/types/name.rs | 2 +- librepology/src/v1/types/repo.rs | 2 +- librepology/src/v1/types/summary.rs | 2 +- librepology/src/v1/types/version.rs | 2 +- librepology/src/v1/types/www.rs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/librepology/src/v1/types/category.rs b/librepology/src/v1/types/category.rs index 1bc8c02..975fe7f 100644 --- a/librepology/src/v1/types/category.rs +++ b/librepology/src/v1/types/category.rs @@ -1,7 +1,7 @@ use std::ops::Deref; // list of package categories -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize, new)] pub struct Category(String); impl Deref for Category { diff --git a/librepology/src/v1/types/download.rs b/librepology/src/v1/types/download.rs index e337baa..d52a2db 100644 --- a/librepology/src/v1/types/download.rs +++ b/librepology/src/v1/types/download.rs @@ -3,7 +3,7 @@ use std::ops::Deref; use url::Url; // list of package downloads -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)] +#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, new)] pub struct Download(#[serde(with = "url_serde")] Url); impl Deref for Download { diff --git a/librepology/src/v1/types/effname.rs b/librepology/src/v1/types/effname.rs index ae38fd7..118f56e 100644 --- a/librepology/src/v1/types/effname.rs +++ b/librepology/src/v1/types/effname.rs @@ -1,7 +1,7 @@ use std::ops::Deref; // list of package downloads -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize, new)] pub struct EffName(String); impl Deref for EffName { diff --git a/librepology/src/v1/types/license.rs b/librepology/src/v1/types/license.rs index 7d67a2e..f755888 100644 --- a/librepology/src/v1/types/license.rs +++ b/librepology/src/v1/types/license.rs @@ -1,7 +1,7 @@ use std::ops::Deref; // list of package licenses -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize, new)] pub struct License(String); impl Deref for License { diff --git a/librepology/src/v1/types/maintainer.rs b/librepology/src/v1/types/maintainer.rs index d76c879..f97fc91 100644 --- a/librepology/src/v1/types/maintainer.rs +++ b/librepology/src/v1/types/maintainer.rs @@ -1,7 +1,7 @@ use std::ops::Deref; // list of package maintainers -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize, new)] pub struct Maintainer(String); impl Deref for Maintainer { diff --git a/librepology/src/v1/types/name.rs b/librepology/src/v1/types/name.rs index 649e70d..70e3317 100644 --- a/librepology/src/v1/types/name.rs +++ b/librepology/src/v1/types/name.rs @@ -1,7 +1,7 @@ use std::ops::Deref; // package name as in repository (if different from version) -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize, new)] pub struct Name(String); impl Deref for Name { diff --git a/librepology/src/v1/types/repo.rs b/librepology/src/v1/types/repo.rs index 7305ec6..062358e 100644 --- a/librepology/src/v1/types/repo.rs +++ b/librepology/src/v1/types/repo.rs @@ -1,7 +1,7 @@ use std::ops::Deref; // name of repository for this package -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize, new)] pub struct Repo(String); impl Deref for Repo { diff --git a/librepology/src/v1/types/summary.rs b/librepology/src/v1/types/summary.rs index 494e671..0595fef 100644 --- a/librepology/src/v1/types/summary.rs +++ b/librepology/src/v1/types/summary.rs @@ -1,7 +1,7 @@ use std::ops::Deref; // one-line description of the package -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize, new)] pub struct Summary(String); impl Deref for Summary { diff --git a/librepology/src/v1/types/version.rs b/librepology/src/v1/types/version.rs index cad703a..7ae7b85 100644 --- a/librepology/src/v1/types/version.rs +++ b/librepology/src/v1/types/version.rs @@ -1,7 +1,7 @@ use std::ops::Deref; // package version (sanitized) -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug, Serialize, Deserialize, new)] pub struct Version(String); impl Deref for Version { diff --git a/librepology/src/v1/types/www.rs b/librepology/src/v1/types/www.rs index a59ef02..1b5b89e 100644 --- a/librepology/src/v1/types/www.rs +++ b/librepology/src/v1/types/www.rs @@ -2,7 +2,7 @@ use std::ops::Deref; use url::Url; // list of package webpages -#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)] +#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, new)] pub struct Www(#[serde(with = "url_serde")] Url); impl Deref for Www { -- cgit v1.2.3