]> git.proxmox.com Git - perlmod.git/commitdiff
doc fixups master
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 30 Jul 2024 13:51:31 +0000 (15:51 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 30 Jul 2024 13:51:31 +0000 (15:51 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
perlmod/src/array.rs
perlmod/src/de.rs
perlmod/src/hash.rs
perlmod/src/lib.rs
perlmod/src/macros.rs
perlmod/src/magic.rs
perlmod/src/scalar.rs
perlmod/src/ser.rs

index d0e510fdbd49301fff6667fd65e247168e7bb20e..2c49a27d0a19346693c7f57c47aec7a12b33e99a 100644 (file)
@@ -1,4 +1,4 @@
-//! Module dealing with perl [`Array`](crate::Array)s. ([`AV`](crate::ffi::AV) pointers).
+//! Module dealing with perl [`Array`]s. ([`AV`] pointers).
 
 use std::marker::PhantomData;
 
@@ -176,7 +176,7 @@ impl std::fmt::Debug for Array {
 ///
 /// Technically the iterator always holds a reference count on the [`AV`] pointer, but we still
 /// distinguish between an iterator going over a borrowed [`Array`] and one coming from
-/// [`IntoIterator`](std::iter::IntoIterator).
+/// [`IntoIterator`].
 pub struct Iter<'a> {
     array: Array,
     at: usize,
index 99017f3bafaaf3676c3999e822bb1133699ba5ad..35bb0c4288464930aefb3412fa63bd4a60b8ecea 100644 (file)
@@ -13,17 +13,17 @@ use crate::scalar::Type;
 use crate::Value;
 use crate::{array, ffi, hash};
 
-/// Perl [`Value`](crate::Value) deserializer.
+/// Perl [`Value`] deserializer.
 struct Deserializer<'de> {
     input: Value,
     option_allowed: bool,
     _lifetime: PhantomData<&'de Value>,
 }
 
-/// Deserialize a perl [`Value`](crate::Value).
+/// Deserialize a perl [`Value`].
 ///
 /// Note that this causes all the underlying data to be copied recursively, except for other
-/// [`Value`](crate::Value) variables, which will be references.
+/// [`Value`] variables, which will be references.
 pub fn from_value<T>(input: Value) -> Result<T, Error>
 where
     T: serde::de::DeserializeOwned,
@@ -34,11 +34,11 @@ where
     Ok(out)
 }
 
-/// Deserialize a reference to a perl [`Value`](crate::Value).
+/// Deserialize a reference to a perl [`Value`].
 ///
 /// Note that this causes all the underlying data to be copied recursively, except for other
-/// [`Value`](crate::Value) variables or `&[u8]` or `&str` types, which will reference the
-/// "original" value (whatever that means for perl).
+/// [`Value`] variables or `&[u8]` or `&str` types, which will reference the "original" value
+/// (whatever that means for perl).
 pub fn from_ref_value<'de, T>(input: &'de Value) -> Result<T, Error>
 where
     T: Deserialize<'de>,
index 96a56d4d16d66fc7af83a3e55601d4d7893908eb..b2148e73fe419df690221f4a29474846af62b1a0 100644 (file)
@@ -1,4 +1,4 @@
-//! Module dealing with perl [`Hash`](crate::Hash)es. ([`HV`](crate::ffi::HV) pointers).
+//! Module dealing with perl [`Hash`](struct@crate::Hash)es. ([`HV`] pointers).
 
 use crate::error::CastError;
 use crate::ffi::{self, HV, SV};
@@ -183,7 +183,7 @@ impl std::fmt::Debug for Hash {
 ///
 /// Perl hashes have an integrated iterator. Perl goes to great lengths to make it impossible to
 /// properly iterate over a hash without messing with the hash's internal state, so contrary to the
-/// array iterator, this iterator always references an existing [`Hash`](crate::Hash).
+/// array iterator, this iterator always references an existing [`Hash`](struct@crate::Hash).
 pub struct Iter<'a> {
     hash: &'a Hash,
 }
index e4eac8f3efb29dcd42ff87cbd532d4c82bba7eae..c360835294dda088c84517a24c81074f91dbf130 100644 (file)
@@ -104,7 +104,7 @@ pub use perlmod_macro::package;
 ///   Implementing the `TryFrom` trait accordingly can make using blessed references more
 ///   convenient, but at the cost of hiding underlying `unsafe` code.
 ///
-/// * `#[cv]`: This can be used on a single parameter of type [`&CV`](perlmod::ffi::CV) to get
+/// * `#[cv]`: This can be used on a single parameter of type [`&CV`](ffi::CV) to get
 ///   access to the `xsub` value used to call the function.
 ///
 ///   This can be used, for instance, to associate callables with data, or to create attach boxed
index 38c137ad26c4dae3c6f709699de3181d0c76f116..29bc9bc4436c6b54e426eff354fd2bc18284cee3 100644 (file)
@@ -112,8 +112,8 @@ macro_rules! destructor {
 /// it.
 ///
 /// Note that this only makes sense if the used [`MagicSpec`] does not include a `free` method.
-/// This method *is* includded when using its `DEFAULT` or the [`declare_magic!`] macro, so this
-/// macro is only required when using custom magic with a custom `DESTROY` sub.
+/// This method *is* includded when using its `DEFAULT` or the [`crate::declare_magic!`] macro, so
+/// this macro is only required when using custom magic with a custom `DESTROY` sub.
 ///
 /// Due to compiler restrictions, the function itself needs to be written manually, only the
 /// contents can be generated using this macro. This also means that the `this` parameter needs to
index 47f76916cf9693887e4fd12b02fc1218b34ae8e7..9f05c91921917c754c383495042a97415d121382 100644 (file)
@@ -3,9 +3,9 @@
 //! This is a safer alternative to directly blessing raw pointer values as it is more difficult to
 //! get the perl side of this wrong.
 //!
-//! For instance, one major downside of using [`Value::bless_box`] is that it is possible to simply
-//! bless invalid values into the same class, or create clones via perl's `Storable::dclone` or
-//! `Clone::clone`, which can easily cause a double-free corruption.
+//! For instance, one major downside of using [`Value::bless_box`](crate::Value::bless_box) is that
+//! it is possible to simply bless invalid values into the same class, or create clones via perl's
+//! `Storable::dclone` or `Clone::clone`, which can easily cause a double-free corruption.
 //!
 //! To avoid this, we can attach a magic value to a perl value (or even multiple magic values if so
 //! desired).
index 9d53a85b06b4ae04be58bb2709818b350759eac7..c849e6bbea4f7e620290b7697c01ed039ac341d6 100644 (file)
@@ -601,7 +601,7 @@ impl ScalarRef {
     /// Note that the `Cow` part is not required here.
     ///
     /// If `self` is a UTF-8 scalar and its memory representation covers the borrowed substring,
-    /// this is equivalent to calling [`Scalar::substr`] with the `index` matching the string.
+    /// this is equivalent to calling [`ScalarRef::substr`] with the `index` matching the string.
     ///
     /// Otherwise (if the provided string is unrelated to `self`), this is also equivalent to
     /// calling `[Scalar::new_string]`.
index 956161563b6c9638d0fbd0068ef0846c6d5f88b0..06f5d4467b80c72c13e40dc9077f42ebdaee4a46 100644 (file)
@@ -17,7 +17,7 @@ pub fn is_active() -> bool {
     raw_value::is_enabled()
 }
 
-/// Serialize data into a perl [`Value`](crate::Value).
+/// Serialize data into a perl [`Value`].
 ///
 /// Note that in theory it should be safe to send such values to different threads as long as their
 /// reference count is exactly one.