Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,18 @@ tokio-stream = "0.1"
tokio-util = { version = "0.7", features = ["io"], default-features = false }
criterion = { package = "codspeed-criterion-compat", version = "4" }
axum = "0.8"

[workspace.lints.clippy]
correctness = "deny"
all = "warn"
complexity = "warn"
suspicious = "warn"
perf = "warn"

[workspace.lints.rust]
rust_2018_idioms = "warn"
rust_2024_compatibility = "warn"
future_incompatible = "warn"
nonstandard_style = "warn"
missing_docs = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
3 changes: 3 additions & 0 deletions crates/engineioxide-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ rand = "0.10"
base64 = "0.22"
serde.workspace = true
bytes.workspace = true

[lints]
workspace = true
29 changes: 0 additions & 29 deletions crates/engineioxide-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
#![warn(
clippy::all,
clippy::todo,
clippy::empty_enum,
clippy::mem_forget,
clippy::unused_self,
clippy::filter_map_next,
clippy::needless_continue,
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::await_holding_lock,
clippy::imprecise_flops,
clippy::suboptimal_flops,
clippy::lossy_float_literal,
clippy::rest_pat_in_fully_bound_structs,
clippy::fn_params_excessive_bools,
clippy::exit,
clippy::inefficient_to_string,
clippy::linkedlist,
clippy::macro_use_imports,
clippy::option_option,
clippy::verbose_file_reads,
clippy::unnested_or_patterns,
rust_2018_idioms,
future_incompatible,
nonstandard_style,
missing_docs
)]
#![doc = include_str!("../README.md")]

mod sid;
Expand Down
3 changes: 3 additions & 0 deletions crates/engineioxide/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ harness = false
name = "packet_decode"
path = "benches/packet_decode.rs"
harness = false

[lints]
workspace = true
30 changes: 0 additions & 30 deletions crates/engineioxide/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(
clippy::all,
clippy::todo,
clippy::empty_enum,
clippy::mem_forget,
clippy::unused_self,
clippy::filter_map_next,
clippy::needless_continue,
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::await_holding_lock,
clippy::imprecise_flops,
clippy::suboptimal_flops,
clippy::lossy_float_literal,
clippy::rest_pat_in_fully_bound_structs,
clippy::fn_params_excessive_bools,
clippy::exit,
clippy::inefficient_to_string,
clippy::linkedlist,
clippy::macro_use_imports,
clippy::option_option,
clippy::verbose_file_reads,
clippy::unnested_or_patterns,
rust_2018_idioms,
rust_2024_compatibility,
future_incompatible,
nonstandard_style,
missing_docs
)]
#![doc = include_str!("../README.md")]

pub use engineioxide_core::Str;
Expand Down
3 changes: 3 additions & 0 deletions crates/parser-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ harness = false
name = "value_encode"
path = "benches/value_encode.rs"
harness = false

[lints]
workspace = true
31 changes: 0 additions & 31 deletions crates/parser-common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
#![warn(
clippy::all,
clippy::todo,
clippy::empty_enum,
clippy::mem_forget,
clippy::unused_self,
clippy::filter_map_next,
clippy::needless_continue,
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::await_holding_lock,
clippy::imprecise_flops,
clippy::suboptimal_flops,
clippy::lossy_float_literal,
clippy::rest_pat_in_fully_bound_structs,
clippy::fn_params_excessive_bools,
clippy::exit,
clippy::inefficient_to_string,
clippy::linkedlist,
clippy::macro_use_imports,
clippy::option_option,
clippy::verbose_file_reads,
clippy::unnested_or_patterns,
rust_2018_idioms,
rust_2024_compatibility,
future_incompatible,
nonstandard_style,
missing_docs
)]

//! The common parser sub-crate for the socketioxide crate.
//!
//! This is the default parser implementation.
Expand Down
3 changes: 3 additions & 0 deletions crates/parser-msgpack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ harness = false
name = "value_encode"
path = "benches/value_encode.rs"
harness = false

[lints]
workspace = true
30 changes: 0 additions & 30 deletions crates/parser-msgpack/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
#![warn(
clippy::all,
clippy::todo,
clippy::empty_enum,
clippy::mem_forget,
clippy::unused_self,
clippy::filter_map_next,
clippy::needless_continue,
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::await_holding_lock,
clippy::imprecise_flops,
clippy::suboptimal_flops,
clippy::lossy_float_literal,
clippy::rest_pat_in_fully_bound_structs,
clippy::fn_params_excessive_bools,
clippy::exit,
clippy::inefficient_to_string,
clippy::linkedlist,
clippy::macro_use_imports,
clippy::option_option,
clippy::verbose_file_reads,
clippy::unnested_or_patterns,
rust_2018_idioms,
future_incompatible,
nonstandard_style,
missing_docs
)]

//! The msgpack parser sub-crate for the socketioxide crate.
//!
//! This is a custom parser implementation that can be enable with the `msgpack` feature flag in socketioxide.
Expand Down
4 changes: 2 additions & 2 deletions crates/socketioxide-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ arbitrary = { version = "1.4.2", features = ["derive"] }
serde_json.workspace = true
rmp-serde.workspace = true

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
[lints]
workspace = true
4 changes: 2 additions & 2 deletions crates/socketioxide-core/src/adapter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,8 @@ impl<E: SocketEmitter> CoreLocalAdapter<E> {
let mut except = get_except_sids(&opts.except, rooms);
// In case of broadcast flag + if the sender is set,
// we should not broadcast to it.
if is_broadcast && opts.sid.is_some() {
except.insert(opts.sid.unwrap());
if is_broadcast && let Some(sid) = opts.sid {
except.insert(sid);
}

if !opts.rooms.is_empty() {
Expand Down
31 changes: 0 additions & 31 deletions crates/socketioxide-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
#![warn(
clippy::all,
clippy::todo,
clippy::empty_enum,
clippy::mem_forget,
clippy::unused_self,
clippy::filter_map_next,
clippy::needless_continue,
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::await_holding_lock,
clippy::imprecise_flops,
clippy::suboptimal_flops,
clippy::lossy_float_literal,
clippy::rest_pat_in_fully_bound_structs,
clippy::fn_params_excessive_bools,
clippy::exit,
clippy::inefficient_to_string,
clippy::linkedlist,
clippy::macro_use_imports,
clippy::option_option,
clippy::verbose_file_reads,
clippy::unnested_or_patterns,
rust_2018_idioms,
rust_2024_compatibility,
future_incompatible,
nonstandard_style,
missing_docs
)]

//! This crate is the core of the socketioxide crate.
//! It contains basic types and interfaces for the socketioxide crate and the parser sub-crates.

Expand Down
3 changes: 3 additions & 0 deletions crates/socketioxide-mongodb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ bytes.workspace = true
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true
29 changes: 0 additions & 29 deletions crates/socketioxide-mongodb/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![warn(
clippy::all,
clippy::todo,
clippy::empty_enum,
clippy::mem_forget,
clippy::unused_self,
clippy::filter_map_next,
clippy::needless_continue,
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::await_holding_lock,
clippy::imprecise_flops,
clippy::suboptimal_flops,
clippy::lossy_float_literal,
clippy::rest_pat_in_fully_bound_structs,
clippy::fn_params_excessive_bools,
clippy::exit,
clippy::inefficient_to_string,
clippy::linkedlist,
clippy::macro_use_imports,
clippy::option_option,
clippy::verbose_file_reads,
clippy::unnested_or_patterns,
rust_2018_idioms,
future_incompatible,
nonstandard_style,
missing_docs
)]
//! # A mongodb adapter implementation for the socketioxide crate.
//! The adapter is used to communicate with other nodes of the same application.
//! This allows to broadcast messages to sockets connected on other servers,
Expand Down
3 changes: 3 additions & 0 deletions crates/socketioxide-redis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ tracing-subscriber.workspace = true
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true
30 changes: 0 additions & 30 deletions crates/socketioxide-redis/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(
clippy::all,
clippy::todo,
clippy::empty_enum,
clippy::mem_forget,
clippy::unused_self,
clippy::filter_map_next,
clippy::needless_continue,
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::await_holding_lock,
clippy::imprecise_flops,
clippy::suboptimal_flops,
clippy::lossy_float_literal,
clippy::rest_pat_in_fully_bound_structs,
clippy::fn_params_excessive_bools,
clippy::exit,
clippy::inefficient_to_string,
clippy::linkedlist,
clippy::macro_use_imports,
clippy::option_option,
clippy::verbose_file_reads,
clippy::unnested_or_patterns,
rust_2018_idioms,
rust_2024_compatibility,
future_incompatible,
nonstandard_style,
missing_docs
)]

//! # A redis/valkey adapter implementation for the socketioxide crate.
//! The adapter is used to communicate with other nodes of the same application.
Expand Down
3 changes: 3 additions & 0 deletions crates/socketioxide/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ rustdoc-args = ["--cfg", "docsrs"]
name = "extensions"
path = "benches/extensions.rs"
harness = false

[lints]
workspace = true
30 changes: 0 additions & 30 deletions crates/socketioxide/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,6 @@
#![doc(
html_favicon_url = "https://raw.githubusercontent.com/Totodore/socketioxide/refs/heads/main/.github/logo_dark.ico"
)]
#![warn(
clippy::all,
clippy::todo,
clippy::empty_enum,
clippy::mem_forget,
clippy::unused_self,
clippy::filter_map_next,
clippy::needless_continue,
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::await_holding_lock,
clippy::imprecise_flops,
clippy::suboptimal_flops,
clippy::lossy_float_literal,
clippy::rest_pat_in_fully_bound_structs,
clippy::fn_params_excessive_bools,
clippy::exit,
clippy::inefficient_to_string,
clippy::linkedlist,
clippy::macro_use_imports,
clippy::option_option,
clippy::verbose_file_reads,
clippy::unnested_or_patterns,
rust_2018_idioms,
rust_2024_compatibility,
future_incompatible,
nonstandard_style,
missing_docs
)]
//! Socketioxide is a socket.io server implementation that works as a tower layer/service.
//! It integrates nicely with the rest of the [`tower`](https://docs.rs/tower/latest/tower/)/[`tokio`]/[`hyper`](https://docs.rs/hyper/latest/hyper/) ecosystem.
//!
Expand Down
5 changes: 2 additions & 3 deletions crates/socketioxide/src/operators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,9 @@ impl<A: Adapter> BroadcastOperators<A> {
.adapter
.broadcast(packet?, self.opts)
.await
.map_err(|e| {
.inspect_err(|_e| {
#[cfg(feature = "tracing")]
tracing::debug!("broadcast error: {e}");
e
tracing::debug!("broadcast error: {_e}");
})?;
Ok(())
}
Expand Down
Loading