Replaced #[allow()]'s with #[expect()]
This commit is contained in:
parent
e08309aacd
commit
12e3732765
@ -30,7 +30,7 @@ pub struct CLogin<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> CLogin<'a> {
|
impl<'a> CLogin<'a> {
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[expect(clippy::too_many_arguments)]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
entity_id: i32,
|
entity_id: i32,
|
||||||
is_hardcore: bool,
|
is_hardcore: bool,
|
||||||
|
|||||||
@ -21,7 +21,7 @@ pub struct CParticle<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> CParticle<'a> {
|
impl<'a> CParticle<'a> {
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[expect(clippy::too_many_arguments)]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
long_distance: bool,
|
long_distance: bool,
|
||||||
x: f64,
|
x: f64,
|
||||||
|
|||||||
@ -22,7 +22,7 @@ pub struct CPlayerChatMessage<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> CPlayerChatMessage<'a> {
|
impl<'a> CPlayerChatMessage<'a> {
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[expect(clippy::too_many_arguments)]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
sender: UUID,
|
sender: UUID,
|
||||||
index: VarInt,
|
index: VarInt,
|
||||||
|
|||||||
@ -22,7 +22,7 @@ pub struct CSpawnEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl CSpawnEntity {
|
impl CSpawnEntity {
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[expect(clippy::too_many_arguments)]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
entity_id: VarInt,
|
entity_id: VarInt,
|
||||||
entity_uuid: UUID,
|
entity_uuid: UUID,
|
||||||
|
|||||||
@ -54,7 +54,7 @@ pub struct ChunkHeightmaps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
#[allow(dead_code)]
|
#[expect(dead_code)]
|
||||||
struct ChunkSection {
|
struct ChunkSection {
|
||||||
#[serde(rename = "Y")]
|
#[serde(rename = "Y")]
|
||||||
y: i32,
|
y: i32,
|
||||||
@ -64,7 +64,7 @@ struct ChunkSection {
|
|||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
#[serde(rename_all = "PascalCase")]
|
#[serde(rename_all = "PascalCase")]
|
||||||
struct ChunkNbt {
|
struct ChunkNbt {
|
||||||
#[allow(dead_code)]
|
#[expect(dead_code)]
|
||||||
data_version: usize,
|
data_version: usize,
|
||||||
|
|
||||||
#[serde(rename = "sections")]
|
#[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
|
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 {
|
fn calculate_heightmap(&self) -> ChunkHeightmaps {
|
||||||
// figure out how LongArray is formatted
|
// figure out how LongArray is formatted
|
||||||
// figure out how to find out if block is motion blocking
|
// figure out how to find out if block is motion blocking
|
||||||
|
|||||||
@ -28,12 +28,12 @@ pub struct ItemElement {
|
|||||||
components: ItemComponents,
|
components: ItemComponents,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[expect(dead_code)]
|
||||||
pub fn get_item_element(item_id: &str) -> &ItemComponents {
|
pub fn get_item_element(item_id: &str) -> &ItemComponents {
|
||||||
&ITEMS.get(item_id).expect("Item not found").components
|
&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 {
|
pub fn get_item_protocol_id(item_id: &str) -> u32 {
|
||||||
global_registry::get_protocol_id(ITEM_REGISTRY, item_id)
|
global_registry::get_protocol_id(ITEM_REGISTRY, item_id)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ pub struct Level {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct SaveFile {
|
struct SaveFile {
|
||||||
#[allow(dead_code)]
|
#[expect(dead_code)]
|
||||||
root_folder: PathBuf,
|
root_folder: PathBuf,
|
||||||
region_folder: PathBuf,
|
region_folder: PathBuf,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use std::hash::{DefaultHasher, Hash, Hasher};
|
use std::hash::{DefaultHasher, Hash, Hasher};
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[expect(dead_code)]
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
pub struct Seed(pub i64);
|
pub struct Seed(pub i64);
|
||||||
|
|
||||||
|
|||||||
@ -13,8 +13,8 @@ use uuid::Uuid;
|
|||||||
use crate::server::Server;
|
use crate::server::Server;
|
||||||
|
|
||||||
#[derive(Deserialize, Clone, Debug)]
|
#[derive(Deserialize, Clone, Debug)]
|
||||||
#[allow(non_snake_case)]
|
#[expect(non_snake_case)]
|
||||||
#[allow(dead_code)]
|
#[expect(dead_code)]
|
||||||
pub struct ProfileTextures {
|
pub struct ProfileTextures {
|
||||||
timestamp: i64,
|
timestamp: i64,
|
||||||
profileId: Uuid,
|
profileId: Uuid,
|
||||||
@ -24,7 +24,7 @@ pub struct ProfileTextures {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Clone, Debug)]
|
#[derive(Deserialize, Clone, Debug)]
|
||||||
#[allow(dead_code)]
|
#[expect(dead_code)]
|
||||||
pub struct Texture {
|
pub struct Texture {
|
||||||
url: String,
|
url: String,
|
||||||
metadata: Option<HashMap<String, String>>,
|
metadata: Option<HashMap<String, String>>,
|
||||||
|
|||||||
@ -72,7 +72,7 @@ pub(crate) fn init_command_tree<'a>() -> CommandTree<'a> {
|
|||||||
)));
|
)));
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
// TODO
|
||||||
#[allow(clippy::let_underscore_future)]
|
#[expect(clippy::let_underscore_future)]
|
||||||
let _ = target.set_gamemode(gamemode);
|
let _ = target.set_gamemode(gamemode);
|
||||||
target.send_system_message(TextComponent::text(&format!(
|
target.send_system_message(TextComponent::text(&format!(
|
||||||
"Game mode was set to {:?}",
|
"Game mode was set to {:?}",
|
||||||
@ -97,7 +97,7 @@ pub(crate) fn init_command_tree<'a>() -> CommandTree<'a> {
|
|||||||
)));
|
)));
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
// TODO
|
||||||
#[allow(clippy::let_underscore_future)]
|
#[expect(clippy::let_underscore_future)]
|
||||||
let _ = target.set_gamemode(gamemode);
|
let _ = target.set_gamemode(gamemode);
|
||||||
target.send_system_message(TextComponent::text(&format!(
|
target.send_system_message(TextComponent::text(&format!(
|
||||||
"Game mode was set to {:?}",
|
"Game mode was set to {:?}",
|
||||||
|
|||||||
@ -131,7 +131,7 @@ impl<'a> NonLeafNodeBuilder<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Matches a sting literal.
|
/// 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 {
|
pub fn literal(string: &str) -> NonLeafNodeBuilder {
|
||||||
NonLeafNodeBuilder {
|
NonLeafNodeBuilder {
|
||||||
node_type: NodeType::Literal { string },
|
node_type: NodeType::Literal { string },
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::await_holding_lock)]
|
#![expect(clippy::await_holding_lock)]
|
||||||
|
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
compile_error!("Compiling for WASI targets is not supported!");
|
compile_error!("Compiling for WASI targets is not supported!");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user