From 879d6de571b3cee9f0d6605234a1c981b2ef6586 Mon Sep 17 00:00:00 2001 From: Speak2Erase Date: Fri, 31 May 2024 16:55:28 -0700 Subject: [PATCH] FIx up documentation --- alox-48/src/de/deserializer.rs | 2 -- alox-48/src/lib.rs | 9 +++------ alox-48/src/rb_types/userdata.rs | 2 +- alox-48/src/ser/serializer.rs | 6 ------ alox-48/src/value/mod.rs | 4 ++-- alox-48/src/value/ser.rs | 4 ++-- 6 files changed, 8 insertions(+), 19 deletions(-) diff --git a/alox-48/src/de/deserializer.rs b/alox-48/src/de/deserializer.rs index c6547d2..645cc78 100644 --- a/alox-48/src/de/deserializer.rs +++ b/alox-48/src/de/deserializer.rs @@ -119,8 +119,6 @@ impl<'de> Deserializer<'de> { /// /// Will error if the input has a version number != to 4.8. /// The first two bytes of marshal data encode the version number. [major, minor] - // this function should never panic in practice as we perform bounds checking. - #[allow(clippy::missing_panics_doc)] pub fn new(input: &'de [u8]) -> Result { let mut cursor = Cursor::new(input); if input.len() < 2 { diff --git a/alox-48/src/lib.rs b/alox-48/src/lib.rs index 60f2f08..c2bb68d 100644 --- a/alox-48/src/lib.rs +++ b/alox-48/src/lib.rs @@ -43,7 +43,7 @@ //! # In alox-48, this is not the case. Each index will be a "unique" ""object"". //! ``` //! -//! This behavior could be simulated with [`Rc`] and/or [`Arc`] like `thurgood`, however for the sake of ergonomics (and memory cycles) +//! This behavior could be simulated with `Rc` and/or `Arc` like `thurgood`, however for the sake of ergonomics (and memory cycles) //! alox-48 deserializes object links as copies instead. alox-48 does not serialize object links at all. //! //! Some common terminology: @@ -107,11 +107,8 @@ where /// Serialize the type into bytes. /// /// # Errors -/// Errors if the type contains data `alox_48` does not support. -/// These include: -/// - Enums -/// - Newtype Structs -/// - Unit Structs +/// +/// Serialization errors are uncommon, and generally result from improper `Serialize` implementations or a bug in alox-48. pub fn to_bytes(data: T) -> Result, SerError> where T: Serialize, diff --git a/alox-48/src/rb_types/userdata.rs b/alox-48/src/rb_types/userdata.rs index 1506397..049965c 100644 --- a/alox-48/src/rb_types/userdata.rs +++ b/alox-48/src/rb_types/userdata.rs @@ -9,7 +9,7 @@ use crate::{ }; /// This type represents types serialized with `_dump` from ruby. -/// Its main intended use is in [`Value`], but you can also use it with [`alox_48::Deserialize`]: +/// Its main intended use is in `Value`, but you can also use it with `Deserialize`: /// /// ``` /// #[derive(alox_48::Deserialize, Debug, PartialEq, Eq)] diff --git a/alox-48/src/ser/serializer.rs b/alox-48/src/ser/serializer.rs index 5ddd039..6fb33b5 100644 --- a/alox-48/src/ser/serializer.rs +++ b/alox-48/src/ser/serializer.rs @@ -11,12 +11,6 @@ use super::{Error, Kind, Result}; use crate::{tag::Tag, Sym, Symbol}; /// The `alox_48` serializer. -/// -/// `alox_48` does not support some data types. -/// These include: -/// - Enums -/// - Newtype Structs -/// - Unit Structs #[derive(Debug, Clone)] pub struct Serializer { /// The underlying output of the serializer. diff --git a/alox-48/src/value/mod.rs b/alox-48/src/value/mod.rs index 59d5a08..a56bed4 100644 --- a/alox-48/src/value/mod.rs +++ b/alox-48/src/value/mod.rs @@ -95,7 +95,7 @@ pub enum Value { }, } -/// Interpret a `alox_48::Value` as an instance of type `T`. +/// Interpret a `Value` as an instance of type `T`. /// /// # Example /// @@ -130,7 +130,7 @@ where T::deserialize(value) } -/// Convert a `T` into `alox_48::Value`. +/// Convert a `T` into `Value`. /// /// # Example /// diff --git a/alox-48/src/value/ser.rs b/alox-48/src/value/ser.rs index 8fa64c9..6e43912 100644 --- a/alox-48/src/value/ser.rs +++ b/alox-48/src/value/ser.rs @@ -42,9 +42,9 @@ impl Serialize for Value { /// Serializer whose output is a `Value`. /// -/// This is the serializer that backs [`alox_48::value::to_value`]. +/// This is the serializer that backs `to_value`. /// Unlike the main alox-48 serializer which goes from some value of `T` to binary data, -/// this one goes from `T` to `alox_48::value::Value`. +/// this one goes from `T` to `Value`. #[derive(Clone, Copy, Debug)] pub struct Serializer;