Skip to content

Commit 8258d97

Browse files
authored
Merge pull request #864 from maxence-cornaton/feature/document-unescape-methods
Document `unescape_value` methods
2 parents 7b9f455 + bc43b5a commit 8258d97

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/events/attributes.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,18 @@ impl<'a> Attribute<'a> {
4141
///
4242
/// See also [`unescape_value_with()`](Self::unescape_value_with)
4343
///
44-
/// This method is available only if [`encoding`] feature is **not** enabled.
44+
/// <div style="background:rgba(120,145,255,0.45);padding:0.75em;">
45+
///
46+
/// NOTE: Because this method is available only if [`encoding`] feature is **not** enabled,
47+
/// should only be used by applications.
48+
/// Libs should use [`decode_and_unescape_value()`](Self::decode_and_unescape_value)
49+
/// instead, because if lib will be used in a project which depends on quick_xml with
50+
/// [`encoding`] feature enabled, the lib will fail to compile due to [feature unification].
51+
///
52+
/// </div>
4553
///
4654
/// [`encoding`]: ../../index.html#encoding
55+
/// [feature unification]: https://doc.rust-lang.org/cargo/reference/features.html#feature-unification
4756
#[cfg(any(doc, not(feature = "encoding")))]
4857
pub fn unescape_value(&self) -> XmlResult<Cow<'a, str>> {
4958
self.unescape_value_with(resolve_predefined_entity)
@@ -60,9 +69,18 @@ impl<'a> Attribute<'a> {
6069
///
6170
/// See also [`unescape_value()`](Self::unescape_value)
6271
///
63-
/// This method is available only if [`encoding`] feature is **not** enabled.
72+
/// <div style="background:rgba(120,145,255,0.45);padding:0.75em;">
73+
///
74+
/// NOTE: Because this method is available only if [`encoding`] feature is **not** enabled,
75+
/// should only be used by applications.
76+
/// Libs should use [`decode_and_unescape_value_with()`](Self::decode_and_unescape_value_with)
77+
/// instead, because if lib will be used in a project which depends on quick_xml with
78+
/// [`encoding`] feature enabled, the lib will fail to compile due to [feature unification].
79+
///
80+
/// </div>
6481
///
6582
/// [`encoding`]: ../../index.html#encoding
83+
/// [feature unification]: https://doc.rust-lang.org/cargo/reference/features.html#feature-unification
6684
#[cfg(any(doc, not(feature = "encoding")))]
6785
#[inline]
6886
pub fn unescape_value_with<'entity>(

0 commit comments

Comments
 (0)