Skip to content

Commit

Permalink
chore(ci): Clippy + doc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxCWhitehead committed Nov 3, 2024
1 parent 7eaf0dd commit 0eb1411
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions framework_crates/bones_framework/src/networking/desync.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
//!
//! Desync detection and history buffer for desync trees.
use std::collections::VecDeque;

use bones_lib::{ecs::World, prelude::default};
use bones_lib::prelude::*;

/// Max frames of data in desync history buffer - this is set to match `ggrs::MAX_CHECKSUM_HISTORY_SIZE`,
/// but is private so cannot be used directly.
const MAX_DESYNC_HISTORY_BUFFER: usize = 32;
pub const MAX_DESYNC_HISTORY_BUFFER: usize = 32;

/// Settings for desync detection
#[derive(Clone)]
Expand All @@ -18,7 +19,7 @@ pub struct DetectDesyncs {
/// By default, [`World`]'s [`DesyncHash`] impl is used.
pub world_hash_func: Option<fn(&World) -> u64>,

/// When using feature `desync-debug`, a [`DesyncTree`] will be built. Resources and Components
/// When using feature `desync-debug`, a [`bones_utils::DesyncTree`] will be built. Resources and Components
/// that do not support hashing can be optionally included in tree to help highlight candidates
/// to be opted into desync-detection.
pub include_unhashable_nodes: bool,
Expand All @@ -33,7 +34,7 @@ impl Default for DetectDesyncs {
}
}
}
/// Store history of desync detection data, such as a [`DesyncTree`]. When ggrs finds a desync in past,
/// Store history of desync detection data, such as a [`bones_utils::DesyncTree`]. When ggrs finds a desync in past,
/// we can retrieve this data for debugging. Ggrs has a fixed limit of pending desync frames it tests,
/// so we match it by keeping the last [`MAX_DESYNC_HISTORY_BUFFER`] of frame data at the desync detect interval.
///
Expand Down
2 changes: 1 addition & 1 deletion framework_crates/bones_utils/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn is_simple_named_attr(attr: &venial::Attribute, name: &str) -> bool {
/// Attribute adding extra functionality for networking.
///
/// For example, provides sugar for `#[derive_type_data(SchemaDesyncHash)]`, which
/// opts in [`SchemaRef`] to support [`DesyncHash`], so it maybe be included in hash for desync detection.
/// opts in `SchemaRef` to support [`DesyncHash`], so it maybe be included in hash for desync detection.
#[proc_macro_attribute]
pub fn net(_attr: TokenStream, item: TokenStream) -> TokenStream {
// Error if #[net] is used with #[schema(no_clone)].
Expand Down
1 change: 1 addition & 0 deletions framework_crates/bones_utils/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct StructB {

#[derive(HasSchema, DesyncHash, Debug, Clone, Default)]
#[desync_hash_module(crate)]
#[allow(dead_code)]
struct StructC {
a: f32,
#[desync_exclude]
Expand Down
2 changes: 1 addition & 1 deletion other_crates/bones_matchmaker/src/matchmaking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ async fn send_matchmaking_updates(
})?;

// Send first update and check active connections
for (_index, conn) in connections.into_iter().enumerate() {
for conn in connections.into_iter() {
if let Ok(mut send) = conn.open_uni().await {
if send.write_all(&first_update_message).await.is_ok()
&& send.finish().is_ok()
Expand Down

0 comments on commit 0eb1411

Please sign in to comment.