[librsvg: 2/3] Remove obsolete note on the lifetime of Attributes
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 2/3] Remove obsolete note on the lifetime of Attributes
- Date: Thu, 8 Oct 2020 16:24:32 +0000 (UTC)
commit 5b0fe329ec84f6dfd3a7b6c65cc86905617e4594
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Oct 8 10:59:42 2020 -0500
Remove obsolete note on the lifetime of Attributes
Attributes is an owned struct now; it's not tied anymore to the
lifetime of libxml2's arrays.
rsvg_internals/src/attributes.rs | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/attributes.rs b/rsvg_internals/src/attributes.rs
index 6c38b1e7..5bf4698a 100644
--- a/rsvg_internals/src/attributes.rs
+++ b/rsvg_internals/src/attributes.rs
@@ -35,15 +35,13 @@ impl Attributes {
/// value_start and value_end point to the start-inclusive and
/// end-exclusive bytes in the attribute's value.
///
+ /// # Safety
+ ///
/// This function is unsafe because the caller must guarantee the following:
///
/// * `attrs` is a valid pointer, with (n_attributes * 5) elements.
///
/// * All strings are valid UTF-8.
- ///
- /// The lifetime of the `Attributes` should be considered the same as the lifetime of the
- /// `attrs` array, as the `Attributes` does not copy the strings - it directly stores pointers
- /// into that array's strings.
pub unsafe fn new_from_xml2_attributes(
n_attributes: usize,
attrs: *const *const libc::c_char,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]