-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix docstrings #442
Fix docstrings #442
Conversation
Codecov Report
@@ Coverage Diff @@
## master #442 +/- ##
==========================================
- Coverage 51.26% 51.25% -0.02%
==========================================
Files 27 27
Lines 13287 13284 -3
==========================================
- Hits 6812 6809 -3
Misses 6475 6475
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This is more complete patch: Changelog.md | 5 +++++
src/de/mod.rs | 9 ++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/Changelog.md b/Changelog.md
index 190afd59..35f00407 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -177,6 +177,10 @@
|`BytesCData::new(impl Into<Cow<[u8]>>)` |`BytesCData::new(impl Into<Cow<str>>)`
|`BytesCData::from_str(&str)` |_(as above)_
+- [#440]: Removed `Deserializer::from_slice` and `quick_xml::de::from_slice` methods
+ because deserializing from a byte array cannot guarantee borrowing due to possible
+ copying while decoding
+
### New Tests
- [#9]: Added tests for incorrect nested tags in input
@@ -212,6 +216,7 @@
[#434]: https://github.com/tafia/quick-xml/pull/434
[#437]: https://github.com/tafia/quick-xml/pull/437
[#439]: https://github.com/tafia/quick-xml/pull/439
+[#440]: https://github.com/tafia/quick-xml/pull/440
## 0.23.0 -- 2022-05-08
diff --git a/src/de/mod.rs b/src/de/mod.rs
index e4d88a0d..0a2469bf 100644
--- a/src/de/mod.rs
+++ b/src/de/mod.rs
@@ -298,7 +298,7 @@ where
/// Deserialize from a reader. This method will do internal copies of data
/// readed from `reader`. If you want have a `&[u8]` or `&str` input and want
-/// to borrow as much as possible, use [`from_slice`] or [`from_str`]
+/// to borrow as much as possible, use [`from_str`].
pub fn from_reader<R, T>(reader: R) -> Result<T, DeError>
where
R: BufRead,
@@ -360,7 +360,6 @@ where
/// Typically it is more convenient to use one of these methods instead:
///
/// - [`Deserializer::from_str`]
- /// - [`Deserializer::from_slice`]
/// - [`Deserializer::from_reader`]
pub fn new(reader: R) -> Self {
Deserializer {
@@ -690,8 +689,8 @@ where
{
/// Create new deserializer that will copy data from the specified reader
/// into internal buffer. If you already have a string or a byte array, use
- /// [`Self::from_str`] or [`Self::from_slice`] instead, because they will
- /// borrow instead of copy, whenever possible
+ /// [`Self::from_str`] instead, because they will borrow instead of copy,
+ /// whenever possible.
pub fn from_reader(reader: R) -> Self {
let mut reader = Reader::from_reader(reader);
reader
@@ -953,7 +952,7 @@ impl<'i, R: BufRead> XmlRead<'i> for IoReader<R> {
/// XML input source that reads from a slice of bytes and can borrow from it.
///
/// You cannot create it, it is created automatically when you call
-/// [`Deserializer::from_str`] or [`Deserializer::from_slice`]
+/// [`Deserializer::from_str`].
pub struct SliceReader<'de> {
reader: Reader<&'de [u8]>,
} |
@Mingun Updated. Although the CI appears to be stuck |
No description provided.