Skip to content

Commit 458a519

Browse files
committed
Fix Contact definition
1 parent 66bd1b3 commit 458a519

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyproject-toml"
3-
version = "0.13.0"
3+
version = "0.13.1"
44
description = "pyproject.toml parser in Rust"
55
edition = "2021"
66
license = "MIT"

src/lib.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,22 @@ pub enum License {
154154
},
155155
}
156156

157-
/// Project people contact information
157+
/// A `project.authors` or `project.maintainers` entry.
158+
///
159+
/// Specified in
160+
/// <https://packaging.python.org/en/latest/specifications/pyproject-toml/#authors-maintainers>.
161+
///
162+
/// The entry is derived from the email format of `John Doe <[email protected]>`. You need to
163+
/// provide at least name or email.
158164
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
159-
#[serde(expecting = "a table with 'name' and 'email' keys")]
160-
pub struct Contact {
161-
/// A valid email name
162-
pub name: Option<String>,
163-
/// A valid email address
164-
pub email: Option<String>,
165+
#[serde(untagged, expecting = "a table with 'name' and/or 'email' keys")]
166+
pub enum Contact {
167+
/// TODO(konsti): RFC 822 validation.
168+
Name { name: String },
169+
/// TODO(konsti): RFC 822 validation.
170+
Email { email: String },
171+
/// TODO(konsti): RFC 822 validation.
172+
NameEmail { name: String, email: String },
165173
}
166174

167175
/// The `[dependency-groups]` section of pyproject.toml, as specified in PEP 735

0 commit comments

Comments
 (0)