Skip to content

Commit

Permalink
fix(clippy): clippy doc lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Totodore committed Oct 5, 2024
1 parent 70856e8 commit b097705
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions crates/socketioxide-core/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
//! The parsing system in socketioxide is split in three phases for serialization and deserialization:
//!
//! ## Deserialization
//! * The SocketIO server receives a packet and calls [`Parse::decode_str`] or [`Parse::decode_bin`]
//! to decode the incoming packet. If a [`ParseError::NeedsMoreBinaryData`] is returned, the server keeps the packet
//! * The SocketIO server receives a packet and calls [`Parse::decode_str`] or [`Parse::decode_bin`]
//! to decode the incoming packet. If a [`ParseError::NeedsMoreBinaryData`] is returned, the server keeps the packet
//! and waits for new incoming data.

Check warning

Code scanning / clippy

doc list item without indentation Warning

doc list item without indentation

Check warning

Code scanning / clippy

doc list item without indentation Warning

doc list item without indentation
//! * Once the packet is complete, the server dispatches the packet to the appropriate namespace
//! and calls [`Parse::read_event`] to route the data to the appropriate event handler.
//! * If the user-provided handler has a `Data` extractor with a provided `T` type, the server
//! calls [`Parse::decode_value`] to deserialize the data. This function will handle the event
//! name as the first argument of the array, as well as variadic arguments.
//! * Once the packet is complete, the server dispatches the packet to the appropriate namespace
//! and calls [`Parse::read_event`] to route the data to the appropriate event handler.
//! * If the user-provided handler has a `Data` extractor with a provided `T` type, the server
//! calls [`Parse::decode_value`] to deserialize the data. This function will handle the event
//! name as the first argument of the array, as well as variadic arguments.
//!
//! ## Serialization
//! * The user calls emit from the socket or namespace with custom `Serializable` data. The server calls
//! [`Parse::encode_value`] to convert this to a raw [`Value`] to be included in the packet. The function
//! will take care of handling the event name as the first argument of the array, along with variadic arguments.
//! * The server then calls [`Parse::encode`] to convert the payload provided by the user,
//! along with other metadata (namespace, ack ID, etc.), into a fully serialized packet ready to be sent.
//! * The user calls emit from the socket or namespace with custom `Serializable` data. The server calls
//! [`Parse::encode_value`] to convert this to a raw [`Value`] to be included in the packet. The function
//! will take care of handling the event name as the first argument of the array, along with variadic arguments.
//! * The server then calls [`Parse::encode`] to convert the payload provided by the user,
//! along with other metadata (namespace, ack ID, etc.), into a fully serialized packet ready to be sent.

use std::{
fmt,
Expand Down Expand Up @@ -85,11 +85,11 @@ pub trait Parse: Default + Copy {
/// Convert any generic [`Value`] to a deserializable type.
/// It should always be an array (according to the serde model).
///
/// * If `with_event` is true, we expect an event str as the first element and we will skip
/// it when deserializing data.
/// * If `T` is a tuple-like type, all the remaining elements of the array will be
/// deserialized (`[...data]`).
/// * If `T` is not a tuple-like type, the first element of the array will be deserialized (`[data]`).
/// * If `with_event` is true, we expect an event str as the first element and we will skip
/// it when deserializing data.
/// * If `T` is a tuple-like type, all the remaining elements of the array will be
/// deserialized (`[...data]`).
/// * If `T` is not a tuple-like type, the first element of the array will be deserialized (`[data]`).
fn decode_value<'de, T: Deserialize<'de>>(
self,
value: &'de mut Value,
Expand Down

0 comments on commit b097705

Please sign in to comment.