Skip to content

Commit fb13346

Browse files
authored
Merge pull request #2223 from GitoxideLabs/copilot/update-gix-url-documentation
Document why `gix-url::Url` doesn't have String serialization and password handling behavior
2 parents 3313233 + 78898a7 commit fb13346

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

gix-url/src/lib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub enum ArgumentSafety<'a> {
7676

7777
/// A URL with support for specialized git related capabilities.
7878
///
79-
/// Additionally there is support for [deserialization](Url::from_bytes()) and [serialization](Url::to_bstring()).
79+
/// Additionally, there is support for [deserialization](Url::from_bytes()) and [serialization](Url::to_bstring()).
8080
///
8181
/// # Mutability Warning
8282
///
@@ -85,6 +85,16 @@ pub enum ArgumentSafety<'a> {
8585
/// parameters, but never be accepted as an instance of this type and then reconstructed, to maintain
8686
/// validity guarantees.
8787
///
88+
/// # Serialization
89+
///
90+
/// This type does not implement `Into<String>`, `From<Url> for String` because URLs
91+
/// can contain non-UTF-8 sequences in the path component when parsed from raw bytes.
92+
/// Use [to_bstring()](Url::to_bstring()) for lossless serialization, or use the [`Display`](std::fmt::Display)
93+
/// trait for a UTF-8 representation that redacts passwords for safe logging.
94+
///
95+
/// When the `serde` feature is enabled, this type implements `serde::Serialize` and `serde::Deserialize`,
96+
/// which will serialize *all* fields, including the password.
97+
///
8898
/// # Security Warning
8999
///
90100
/// URLs may contain passwords and using standard [formatting](std::fmt::Display) will redact

0 commit comments

Comments
 (0)