diff options
Diffstat (limited to 'vendor/spdx-rs/src')
-rw-r--r-- | vendor/spdx-rs/src/models/annotation.rs | 6 | ||||
-rw-r--r-- | vendor/spdx-rs/src/models/checksum.rs | 4 | ||||
-rw-r--r-- | vendor/spdx-rs/src/models/document_creation_information.rs | 8 | ||||
-rw-r--r-- | vendor/spdx-rs/src/models/file_information.rs | 4 | ||||
-rw-r--r-- | vendor/spdx-rs/src/models/other_licensing_information_detected.rs | 2 | ||||
-rw-r--r-- | vendor/spdx-rs/src/models/package_information.rs | 8 | ||||
-rw-r--r-- | vendor/spdx-rs/src/models/snippet.rs | 6 | ||||
-rw-r--r-- | vendor/spdx-rs/src/models/spdx_document.rs | 2 | ||||
-rw-r--r-- | vendor/spdx-rs/src/parsers/mod.rs | 4 | ||||
-rw-r--r-- | vendor/spdx-rs/src/parsers/tag_value.rs | 8 |
10 files changed, 26 insertions, 26 deletions
diff --git a/vendor/spdx-rs/src/models/annotation.rs b/vendor/spdx-rs/src/models/annotation.rs index f5396aa1d..6e82b6274 100644 --- a/vendor/spdx-rs/src/models/annotation.rs +++ b/vendor/spdx-rs/src/models/annotation.rs @@ -6,7 +6,7 @@ use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; /// <https://spdx.github.io/spdx-spec/8-annotations/> -#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct Annotation { /// <https://spdx.github.io/spdx-spec/8-annotations/#81-annotator> @@ -47,7 +47,7 @@ impl Annotation { } /// <https://spdx.github.io/spdx-spec/8-annotations/#83-annotation-type> -#[derive(Serialize, Deserialize, Debug, PartialEq, Clone, Copy)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone, Copy)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum AnnotationType { Review, @@ -84,7 +84,7 @@ mod test { .unwrap(); assert_eq!( spdx_file.annotations[0].annotation_date, - Utc.ymd(2010, 1, 29).and_hms(18, 30, 22) + Utc.with_ymd_and_hms(2010, 1, 29, 18, 30, 22).unwrap() ); } diff --git a/vendor/spdx-rs/src/models/checksum.rs b/vendor/spdx-rs/src/models/checksum.rs index bd91f4c7a..f8e2bc258 100644 --- a/vendor/spdx-rs/src/models/checksum.rs +++ b/vendor/spdx-rs/src/models/checksum.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; /// and /// [File Checksum](https://spdx.github.io/spdx-spec/4-file-information/#44-file-checksum). /// According to the spec, SHA1 is mandatory but we don't currently enforce that. -#[derive(Debug, Serialize, Deserialize, PartialEq, PartialOrd, Clone)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Clone)] pub struct Checksum { /// Algorithm used to calculate the checksum pub algorithm: Algorithm, @@ -32,7 +32,7 @@ impl Checksum { /// Possible algorithms to be used for SPDX's /// [package checksum](https://spdx.github.io/spdx-spec/3-package-information/#310-package-checksum) /// and [file checksum](https://spdx.github.io/spdx-spec/4-file-information/#44-file-checksum). -#[derive(Debug, Serialize, Deserialize, PartialEq, PartialOrd, Clone, Copy)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Clone, Copy)] pub enum Algorithm { SHA1, SHA224, diff --git a/vendor/spdx-rs/src/models/document_creation_information.rs b/vendor/spdx-rs/src/models/document_creation_information.rs index 610803354..6a3c01e66 100644 --- a/vendor/spdx-rs/src/models/document_creation_information.rs +++ b/vendor/spdx-rs/src/models/document_creation_information.rs @@ -10,7 +10,7 @@ use super::Checksum; /// ## Document Creation Information /// /// SPDX's [Document Creation Information](https://spdx.github.io/spdx-spec/2-document-creation-information/) -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct DocumentCreationInformation { /// <https://spdx.github.io/spdx-spec/2-document-creation-information/#21-spdx-version> @@ -69,7 +69,7 @@ impl Default for DocumentCreationInformation { } } -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct CreationInfo { /// <https://spdx.github.io/spdx-spec/2-document-creation-information/#27-license-list-version> @@ -104,7 +104,7 @@ impl Default for CreationInfo { } /// <https://spdx.github.io/spdx-spec/2-document-creation-information/#26-external-document-references> -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, PartialOrd)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd)] pub struct ExternalDocumentReference { /// Unique ID string of the reference. #[serde(rename = "externalDocumentId")] @@ -236,7 +236,7 @@ mod test { .unwrap(); assert_eq!( spdx.document_creation_information.creation_info.created, - Utc.ymd(2010, 1, 29).and_hms(18, 30, 22) + Utc.with_ymd_and_hms(2010, 1, 29, 18, 30, 22).unwrap() ); } #[test] diff --git a/vendor/spdx-rs/src/models/file_information.rs b/vendor/spdx-rs/src/models/file_information.rs index f2db6e030..aba2defe7 100644 --- a/vendor/spdx-rs/src/models/file_information.rs +++ b/vendor/spdx-rs/src/models/file_information.rs @@ -10,7 +10,7 @@ use super::{Algorithm, Checksum}; /// ## File Information /// /// SPDX's [File Information](https://spdx.github.io/spdx-spec/4-file-information/) -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct FileInformation { /// <https://spdx.github.io/spdx-spec/4-file-information/#41-file-name> @@ -127,7 +127,7 @@ impl FileInformation { } /// <https://spdx.github.io/spdx-spec/4-file-information/#43-file-type> -#[derive(Debug, Serialize, Deserialize, PartialEq, PartialOrd, Clone, Copy)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Clone, Copy)] #[serde(rename_all = "UPPERCASE")] pub enum FileType { Source, diff --git a/vendor/spdx-rs/src/models/other_licensing_information_detected.rs b/vendor/spdx-rs/src/models/other_licensing_information_detected.rs index 30bd1d318..28ba8b683 100644 --- a/vendor/spdx-rs/src/models/other_licensing_information_detected.rs +++ b/vendor/spdx-rs/src/models/other_licensing_information_detected.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; /// <https://spdx.github.io/spdx-spec/6-other-licensing-information-detected/> -#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct OtherLicensingInformationDetected { /// <https://spdx.github.io/spdx-spec/6-other-licensing-information-detected/#61-license-identifier> diff --git a/vendor/spdx-rs/src/models/package_information.rs b/vendor/spdx-rs/src/models/package_information.rs index 1cfd938f8..c5d73fb3f 100644 --- a/vendor/spdx-rs/src/models/package_information.rs +++ b/vendor/spdx-rs/src/models/package_information.rs @@ -12,7 +12,7 @@ use super::{Checksum, FileInformation}; /// ## Package Information /// /// SPDX's [Package Information](https://spdx.github.io/spdx-spec/3-package-information/). -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct PackageInformation { /// <https://spdx.github.io/spdx-spec/3-package-information/#31-package-name> @@ -203,7 +203,7 @@ impl PackageInformation { } /// <https://spdx.github.io/spdx-spec/3-package-information/#39-package-verification-code> -#[derive(Debug, Serialize, Deserialize, PartialEq, PartialOrd, Clone)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Clone)] pub struct PackageVerificationCode { /// Value of the verification code. #[serde(rename = "packageVerificationCodeValue")] @@ -225,7 +225,7 @@ impl PackageVerificationCode { } /// <https://spdx.github.io/spdx-spec/3-package-information/#321-external-reference> -#[derive(Serialize, Deserialize, Debug, PartialEq, PartialOrd, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Clone)] #[serde(rename_all = "camelCase")] pub struct ExternalPackageReference { pub reference_category: ExternalPackageReferenceCategory, @@ -254,7 +254,7 @@ impl ExternalPackageReference { } /// <https://spdx.github.io/spdx-spec/3-package-information/#321-external-reference> -#[derive(Serialize, Deserialize, Debug, PartialEq, PartialOrd, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Clone)] #[serde(rename_all = "SCREAMING-KEBAB-CASE")] pub enum ExternalPackageReferenceCategory { Security, diff --git a/vendor/spdx-rs/src/models/snippet.rs b/vendor/spdx-rs/src/models/snippet.rs index e4a644ac5..7585a0087 100644 --- a/vendor/spdx-rs/src/models/snippet.rs +++ b/vendor/spdx-rs/src/models/snippet.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use spdx_expression::SpdxExpression; /// <https://spdx.github.io/spdx-spec/5-snippet-information/> -#[derive(Serialize, Deserialize, Debug, PartialEq, Clone, Default)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone, Default)] pub struct Snippet { /// <https://spdx.github.io/spdx-spec/5-snippet-information/#51-snippet-spdx-identifier> #[serde(rename = "SPDXID")] @@ -61,7 +61,7 @@ pub struct Snippet { } /// <https://spdx.github.io/spdx-spec/5-snippet-information/#53-snippet-byte-range> -#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct Range { pub start_pointer: Pointer, @@ -77,7 +77,7 @@ impl Range { } } -#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] #[serde(untagged)] pub enum Pointer { Byte { diff --git a/vendor/spdx-rs/src/models/spdx_document.rs b/vendor/spdx-rs/src/models/spdx_document.rs index d7db1009a..df619e5dc 100644 --- a/vendor/spdx-rs/src/models/spdx_document.rs +++ b/vendor/spdx-rs/src/models/spdx_document.rs @@ -37,7 +37,7 @@ use super::{ /// [Serde]: https://serde.rs /// [review information]: https://spdx.github.io/spdx-spec/review-information-deprecated/ /// [tag-value format]: https://spdx.github.io/spdx-spec/conformance/ -#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SPDX { /// <https://spdx.github.io/spdx-spec/2-document-creation-information/> diff --git a/vendor/spdx-rs/src/parsers/mod.rs b/vendor/spdx-rs/src/parsers/mod.rs index 59ce03bae..48c863fca 100644 --- a/vendor/spdx-rs/src/parsers/mod.rs +++ b/vendor/spdx-rs/src/parsers/mod.rs @@ -777,7 +777,7 @@ mod test_super { .contains(&"Person: Jane Doe ()".to_string())); assert_eq!( document_creation_information.creation_info.created, - Utc.ymd(2010, 1, 29).and_hms(18, 30, 22) + Utc.with_ymd_and_hms(2010, 1, 29, 18, 30, 22).unwrap() ); assert_eq!( document_creation_information.creation_info.creator_comment, @@ -1050,7 +1050,7 @@ THE SOFTWARE IS PROVIDED �AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMP annotations[2], Annotation::new( "Person: Suzanne Reviewer".to_string(), - Utc.ymd(2011, 3, 13).and_hms(0, 0, 0), + Utc.with_ymd_and_hms(2011, 3, 13, 0, 0, 0).unwrap(), AnnotationType::Review, Some("SPDXRef-DOCUMENT".to_string()), "Another example reviewer.".to_string() diff --git a/vendor/spdx-rs/src/parsers/tag_value.rs b/vendor/spdx-rs/src/parsers/tag_value.rs index 0c8fdb4e3..765348d2f 100644 --- a/vendor/spdx-rs/src/parsers/tag_value.rs +++ b/vendor/spdx-rs/src/parsers/tag_value.rs @@ -273,7 +273,7 @@ fn file_type(i: &str) -> IResult<&str, FileType, VerboseError<&str>> { } } -fn document_ref<'a>(i: &'a str) -> IResult<&'a str, &str, VerboseError<&'a str>> { +fn document_ref(i: &str) -> IResult<&str, &str, VerboseError<&str>> { preceded(tag("DocumentRef-"), ws(idstring))(i) } @@ -395,7 +395,7 @@ fn range(i: &str) -> IResult<&str, (i32, i32), VerboseError<&str>> { )(i) } -fn idstring<'a>(i: &'a str) -> IResult<&'a str, &str, VerboseError<&'a str>> { +fn idstring(i: &str) -> IResult<&str, &str, VerboseError<&str>> { take_while(|c: char| c.is_alphanum() || c == '.' || c == '-' || c == '+')(i) } @@ -427,7 +427,7 @@ fn tv_comment(i: &str) -> IResult<&str, Atom, VerboseError<&str>> { })(i) } -fn tag_value<'a>(i: &'a str) -> IResult<&'a str, (&str, &str), VerboseError<&'a str>> { +fn tag_value(i: &str) -> IResult<&str, (&str, &str), VerboseError<&str>> { separated_pair( ws(alphanumeric0), tag(":"), @@ -435,7 +435,7 @@ fn tag_value<'a>(i: &'a str) -> IResult<&'a str, (&str, &str), VerboseError<&'a )(i) } -fn multiline_text<'a>(i: &'a str) -> IResult<&'a str, &str, VerboseError<&'a str>> { +fn multiline_text(i: &str) -> IResult<&str, &str, VerboseError<&str>> { delimited(tag("<text>"), take_until("</text>"), tag("</text>"))(i) } |