Skip to content

Commit

Permalink
Update time, fix lint errors, bump minor version.
Browse files Browse the repository at this point in the history
Use serde rename_all = "camelCase".
  • Loading branch information
tmpfs committed Dec 11, 2024
1 parent 046cf21 commit 6804fcf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vcard4"
version = "0.5.2"
version = "0.5.3"
edition = "2021"
description = "Fast and correct vCard parser for RFC6350"
repository = "https://github.com/tmpfs/vcard4"
Expand All @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
thiserror = "1"
logos = { version = "0.14", features = ["export_derive"] }
uriparse = "0.6.4"
time = { version = "0.3.19", features = ["parsing", "formatting"] }
time = { version = "0.3.37", features = ["parsing", "formatting"] }
unicode-segmentation="1"
aho-corasick = "0.7"
serde = { version = "1", features = ["derive"], optional = true }
Expand Down
17 changes: 9 additions & 8 deletions src/vcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::{iter, property::*, Error, Result};
/// The vCard type.
#[derive(Debug, Default, Eq, PartialEq, Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "zeroize", derive(Zeroize, ZeroizeOnDrop))]
pub struct Vcard {
// General
Expand Down Expand Up @@ -341,7 +342,7 @@ impl fmt::Display for Vcard {
for val in &self.source {
write!(f, "{}\r\n", content_line(val, SOURCE))?;
}
for val in &self.kind {
if let Some(val) = &self.kind {
write!(f, "{}\r\n", content_line(val, KIND))?;
}
for val in &self.xml {
Expand All @@ -352,7 +353,7 @@ impl fmt::Display for Vcard {
for val in &self.formatted_name {
write!(f, "{}\r\n", content_line(val, FN))?;
}
for val in &self.name {
if let Some(val) = &self.name {
write!(f, "{}\r\n", content_line(val, N))?;
}
for val in &self.nickname {
Expand All @@ -361,13 +362,13 @@ impl fmt::Display for Vcard {
for val in &self.photo {
write!(f, "{}\r\n", content_line(val, PHOTO))?;
}
for val in &self.bday {
if let Some(val) = &self.bday {
write!(f, "{}\r\n", content_line(val, BDAY))?;
}
for val in &self.anniversary {
if let Some(val) = &self.anniversary {
write!(f, "{}\r\n", content_line(val, ANNIVERSARY))?;
}
for val in &self.gender {
if let Some(val) = &self.gender {
write!(f, "{}\r\n", content_line(val, GENDER))?;
}
for val in &self.url {
Expand Down Expand Up @@ -428,16 +429,16 @@ impl fmt::Display for Vcard {
for val in &self.note {
write!(f, "{}\r\n", content_line(val, NOTE))?;
}
for val in &self.prod_id {
if let Some(val) = &self.prod_id {
write!(f, "{}\r\n", content_line(val, PRODID))?;
}
for val in &self.rev {
if let Some(val) = &self.rev {
write!(f, "{}\r\n", content_line(val, REV))?;
}
for val in &self.sound {
write!(f, "{}\r\n", content_line(val, SOUND))?;
}
for val in &self.uid {
if let Some(val) = &self.uid {
write!(f, "{}\r\n", content_line(val, UID))?;
}
for val in &self.client_pid_map {
Expand Down

0 comments on commit 6804fcf

Please sign in to comment.