diff --git a/pumpkin-core/src/text/hover.rs b/pumpkin-core/src/text/hover.rs index f01d8f30b..d9651fa4b 100644 --- a/pumpkin-core/src/text/hover.rs +++ b/pumpkin-core/src/text/hover.rs @@ -6,7 +6,6 @@ use super::Text; #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(tag = "action", content = "contents", rename_all = "snake_case")] -#[allow(clippy::enum_variant_names)] pub enum HoverEvent<'a> { /// Displays a tooltip with the given text. ShowText(Text<'a>), diff --git a/pumpkin-inventory/src/player.rs b/pumpkin-inventory/src/player.rs index fd92220a9..3aa5963a7 100644 --- a/pumpkin-inventory/src/player.rs +++ b/pumpkin-inventory/src/player.rs @@ -1,6 +1,5 @@ use pumpkin_world::item::Item; -#[allow(dead_code)] pub struct PlayerInventory { // Main Inventory + Hotbar crafting: [Option; 4], diff --git a/pumpkin-protocol/src/client/play/c_login.rs b/pumpkin-protocol/src/client/play/c_login.rs index 7990bba96..5fcbf28b4 100644 --- a/pumpkin-protocol/src/client/play/c_login.rs +++ b/pumpkin-protocol/src/client/play/c_login.rs @@ -30,7 +30,7 @@ pub struct CLogin<'a> { } impl<'a> CLogin<'a> { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( entity_id: i32, is_hardcore: bool, diff --git a/pumpkin-protocol/src/client/play/c_particle.rs b/pumpkin-protocol/src/client/play/c_particle.rs index c3fa35a17..4ea1b66a2 100644 --- a/pumpkin-protocol/src/client/play/c_particle.rs +++ b/pumpkin-protocol/src/client/play/c_particle.rs @@ -21,7 +21,7 @@ pub struct CParticle<'a> { } impl<'a> CParticle<'a> { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( long_distance: bool, x: f64, diff --git a/pumpkin-protocol/src/client/play/c_player_chat_message.rs b/pumpkin-protocol/src/client/play/c_player_chat_message.rs index a79d0516c..8ec95ddca 100644 --- a/pumpkin-protocol/src/client/play/c_player_chat_message.rs +++ b/pumpkin-protocol/src/client/play/c_player_chat_message.rs @@ -22,7 +22,7 @@ pub struct CPlayerChatMessage<'a> { } impl<'a> CPlayerChatMessage<'a> { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( sender: UUID, index: VarInt, diff --git a/pumpkin-protocol/src/client/play/c_spawn_player.rs b/pumpkin-protocol/src/client/play/c_spawn_player.rs index ca3a7e3cc..73d0f8541 100644 --- a/pumpkin-protocol/src/client/play/c_spawn_player.rs +++ b/pumpkin-protocol/src/client/play/c_spawn_player.rs @@ -22,7 +22,7 @@ pub struct CSpawnEntity { } impl CSpawnEntity { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( entity_id: VarInt, entity_uuid: UUID, diff --git a/pumpkin-protocol/src/packet_encoder.rs b/pumpkin-protocol/src/packet_encoder.rs index 511d095d2..36b9c3697 100644 --- a/pumpkin-protocol/src/packet_encoder.rs +++ b/pumpkin-protocol/src/packet_encoder.rs @@ -22,8 +22,6 @@ pub struct PacketEncoder { } impl PacketEncoder { - // i think clippy is broken - #[allow(clippy::needless_borrows_for_generic_args)] pub fn append_packet(&mut self, packet: &P) -> Result<(), PacketError> { let start_len = self.buf.len(); @@ -87,6 +85,7 @@ impl PacketEncoder { let mut front = &mut self.buf[start_len..]; + #[allow(clippy::needless_borrows_for_generic_args)] VarInt(packet_len as i32) .encode(&mut front) .map_err(|_| PacketError::EncodeLength)?; diff --git a/pumpkin-protocol/src/slot.rs b/pumpkin-protocol/src/slot.rs index 2ccab79b9..58386bbe2 100644 --- a/pumpkin-protocol/src/slot.rs +++ b/pumpkin-protocol/src/slot.rs @@ -7,7 +7,6 @@ use serde::{ }; #[derive(Debug, Clone)] -#[allow(dead_code)] pub struct Slot { item_count: VarInt, item_id: Option, diff --git a/pumpkin-world/src/chunk.rs b/pumpkin-world/src/chunk.rs index 1c13d423c..dd5aa643b 100644 --- a/pumpkin-world/src/chunk.rs +++ b/pumpkin-world/src/chunk.rs @@ -54,7 +54,7 @@ pub struct ChunkHeightmaps { } #[derive(Deserialize, Debug)] -#[allow(dead_code)] +#[expect(dead_code)] struct ChunkSection { #[serde(rename = "Y")] y: i32, @@ -64,7 +64,7 @@ struct ChunkSection { #[derive(Deserialize, Debug)] #[serde(rename_all = "PascalCase")] struct ChunkNbt { - #[allow(dead_code)] + #[expect(dead_code)] data_version: usize, #[serde(rename = "sections")] @@ -171,7 +171,7 @@ impl ChunkBlocks { index.y.get_absolute() as usize * CHUNK_AREA + *index.z as usize * 16 + *index.x as usize } - #[allow(dead_code)] + #[expect(dead_code)] fn calculate_heightmap(&self) -> ChunkHeightmaps { // figure out how LongArray is formatted // figure out how to find out if block is motion blocking diff --git a/pumpkin-world/src/global_registry.rs b/pumpkin-world/src/global_registry.rs index 1723cb8f8..19f8a6e6f 100644 --- a/pumpkin-world/src/global_registry.rs +++ b/pumpkin-world/src/global_registry.rs @@ -24,7 +24,6 @@ pub fn get_protocol_id(category: &str, entry: &str) -> u32 { .expect("No Entry found") } -#[allow(dead_code)] pub fn get_default<'a>(category: &str) -> Option<&'a str> { REGISTRY .get(category) diff --git a/pumpkin-world/src/item/item_registry.rs b/pumpkin-world/src/item/item_registry.rs index 9f3f64ab4..f91dd300c 100644 --- a/pumpkin-world/src/item/item_registry.rs +++ b/pumpkin-world/src/item/item_registry.rs @@ -28,12 +28,12 @@ pub struct ItemElement { components: ItemComponents, } -#[allow(dead_code)] +#[expect(dead_code)] pub fn get_item_element(item_id: &str) -> &ItemComponents { &ITEMS.get(item_id).expect("Item not found").components } -#[allow(dead_code)] +#[expect(dead_code)] pub fn get_item_protocol_id(item_id: &str) -> u32 { global_registry::get_protocol_id(ITEM_REGISTRY, item_id) } diff --git a/pumpkin-world/src/level.rs b/pumpkin-world/src/level.rs index 9f3f9f403..aded912cd 100644 --- a/pumpkin-world/src/level.rs +++ b/pumpkin-world/src/level.rs @@ -26,7 +26,7 @@ pub struct Level { } struct SaveFile { - #[allow(dead_code)] + #[expect(dead_code)] root_folder: PathBuf, region_folder: PathBuf, } diff --git a/pumpkin-world/src/world_gen/generator.rs b/pumpkin-world/src/world_gen/generator.rs index 75ec90838..d74949e00 100644 --- a/pumpkin-world/src/world_gen/generator.rs +++ b/pumpkin-world/src/world_gen/generator.rs @@ -12,7 +12,6 @@ pub trait GeneratorInit { } pub trait WorldGenerator: Sync + Send { - #[allow(dead_code)] fn generate_chunk(&self, at: Vector2) -> ChunkData; } assert_obj_safe! {WorldGenerator} diff --git a/pumpkin-world/src/world_gen/implementations/superflat.rs b/pumpkin-world/src/world_gen/implementations/superflat.rs index edbbcf4ba..9d0e57efd 100644 --- a/pumpkin-world/src/world_gen/implementations/superflat.rs +++ b/pumpkin-world/src/world_gen/implementations/superflat.rs @@ -9,7 +9,6 @@ use crate::{ }, }; -#[allow(dead_code)] pub type SuperflatGenerator = GenericGenerator; pub(crate) struct SuperflatBiomeGenerator {} diff --git a/pumpkin-world/src/world_gen/mod.rs b/pumpkin-world/src/world_gen/mod.rs index 9ab676e24..fd0692bdd 100644 --- a/pumpkin-world/src/world_gen/mod.rs +++ b/pumpkin-world/src/world_gen/mod.rs @@ -9,7 +9,6 @@ pub use seed::Seed; use generator::GeneratorInit; use implementations::superflat::SuperflatGenerator; -#[allow(dead_code)] pub fn get_world_gen(seed: Seed) -> Box { // TODO decide which WorldGenerator to pick based on config. Box::new(SuperflatGenerator::new(seed)) diff --git a/pumpkin-world/src/world_gen/seed.rs b/pumpkin-world/src/world_gen/seed.rs index a3245c2b6..884eb4a3d 100644 --- a/pumpkin-world/src/world_gen/seed.rs +++ b/pumpkin-world/src/world_gen/seed.rs @@ -1,6 +1,6 @@ use std::hash::{DefaultHasher, Hash, Hasher}; -#[allow(dead_code)] +#[expect(dead_code)] #[derive(Clone, Copy)] pub struct Seed(pub i64); diff --git a/pumpkin/src/client/authentication.rs b/pumpkin/src/client/authentication.rs index 692cf266c..1320d934d 100644 --- a/pumpkin/src/client/authentication.rs +++ b/pumpkin/src/client/authentication.rs @@ -13,8 +13,8 @@ use uuid::Uuid; use crate::server::Server; #[derive(Deserialize, Clone, Debug)] -#[allow(non_snake_case)] -#[allow(dead_code)] +#[expect(non_snake_case)] +#[expect(dead_code)] pub struct ProfileTextures { timestamp: i64, profileId: Uuid, @@ -24,8 +24,7 @@ pub struct ProfileTextures { } #[derive(Deserialize, Clone, Debug)] -#[allow(non_snake_case)] -#[allow(dead_code)] +#[expect(dead_code)] pub struct Texture { url: String, metadata: Option>, diff --git a/pumpkin/src/commands/cmd_gamemode.rs b/pumpkin/src/commands/cmd_gamemode.rs index 17e47fea4..d7b25ecf5 100644 --- a/pumpkin/src/commands/cmd_gamemode.rs +++ b/pumpkin/src/commands/cmd_gamemode.rs @@ -72,7 +72,7 @@ pub(crate) fn init_command_tree<'a>() -> CommandTree<'a> { ))); } else { // TODO - #[allow(clippy::let_underscore_future)] + #[expect(clippy::let_underscore_future)] let _ = target.set_gamemode(gamemode); target.send_system_message(TextComponent::text(&format!( "Game mode was set to {:?}", @@ -97,7 +97,7 @@ pub(crate) fn init_command_tree<'a>() -> CommandTree<'a> { ))); } else { // TODO - #[allow(clippy::let_underscore_future)] + #[expect(clippy::let_underscore_future)] let _ = target.set_gamemode(gamemode); target.send_system_message(TextComponent::text(&format!( "Game mode was set to {:?}", diff --git a/pumpkin/src/commands/tree.rs b/pumpkin/src/commands/tree.rs index eb0647826..63243be59 100644 --- a/pumpkin/src/commands/tree.rs +++ b/pumpkin/src/commands/tree.rs @@ -23,8 +23,9 @@ pub(crate) enum NodeType<'a> { run: &'a (dyn Fn(&mut CommandSender, &mut Server, &ConsumedArgs) -> Result<(), InvalidTreeError> + Sync), }, - #[allow(dead_code)] // todo: remove (so far no commands requiring this are implemented) - Literal { string: &'a str }, + Literal { + string: &'a str, + }, Argument { name: &'a str, consumer: ArgumentConsumer<'a>, diff --git a/pumpkin/src/commands/tree_builder.rs b/pumpkin/src/commands/tree_builder.rs index 338dc5f69..acb285259 100644 --- a/pumpkin/src/commands/tree_builder.rs +++ b/pumpkin/src/commands/tree_builder.rs @@ -131,7 +131,7 @@ impl<'a> NonLeafNodeBuilder<'a> { } /// Matches a sting literal. -#[allow(dead_code)] // todo: remove (so far no commands requiring this are implemented) +#[expect(dead_code)] // todo: remove (so far no commands requiring this are implemented) pub fn literal(string: &str) -> NonLeafNodeBuilder { NonLeafNodeBuilder { node_type: NodeType::Literal { string }, diff --git a/pumpkin/src/main.rs b/pumpkin/src/main.rs index 18bc812b0..3ac0c7840 100644 --- a/pumpkin/src/main.rs +++ b/pumpkin/src/main.rs @@ -1,5 +1,4 @@ -#![allow(clippy::await_holding_refcell_ref)] -#![allow(clippy::await_holding_lock)] +#![expect(clippy::await_holding_lock)] #[cfg(target_os = "wasi")] compile_error!("Compiling for WASI targets is not supported!");