Skip to content

Commit

Permalink
Stricter serde constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
colincasey committed Feb 29, 2024
1 parent d3403bc commit 292e640
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/aptfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::collections::HashSet;
use std::str::FromStr;

#[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub(crate) struct Aptfile {
packages: HashSet<DebianPackageName>,
}
Expand Down
1 change: 1 addition & 0 deletions src/debian.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::fmt::{Display, Formatter};
use std::str::FromStr;

#[derive(Debug, Eq, PartialEq, Hash, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
// https://www.debian.org/doc/debian-policy/ch-controlfields.html#source
pub(crate) struct DebianPackageName(pub(crate) String);

Expand Down
1 change: 1 addition & 0 deletions src/layers/installed_packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl<'a> Layer for InstalledPackagesLayer<'a> {
}

#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub(crate) struct InstalledPackagesMetadata {
arch: String,
aptfile: Aptfile,
Expand Down

0 comments on commit 292e640

Please sign in to comment.