Skip to content

Commit

Permalink
FIx up documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed May 31, 2024
1 parent e1f3515 commit 879d6de
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 19 deletions.
2 changes: 0 additions & 2 deletions alox-48/src/de/deserializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self> {
let mut cursor = Cursor::new(input);
if input.len() < 2 {
Expand Down
9 changes: 3 additions & 6 deletions alox-48/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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<T>(data: T) -> Result<Vec<u8>, SerError>
where
T: Serialize,
Expand Down
2 changes: 1 addition & 1 deletion alox-48/src/rb_types/userdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
6 changes: 0 additions & 6 deletions alox-48/src/ser/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions alox-48/src/value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -130,7 +130,7 @@ where
T::deserialize(value)
}

/// Convert a `T` into `alox_48::Value`.
/// Convert a `T` into `Value`.
///
/// # Example
///
Expand Down
4 changes: 2 additions & 2 deletions alox-48/src/value/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 879d6de

Please sign in to comment.