1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-04 02:24:12 +02:00

static baseline warnings

This commit is contained in:
Robin Appelman 2022-04-18 19:44:47 +02:00
commit 00610a9a95
3 changed files with 41 additions and 3 deletions

View file

@ -51,6 +51,12 @@ impl From<ClassId> for u16 {
}
}
impl PartialEq<u16> for ClassId {
fn eq(&self, other: &u16) -> bool {
self.0 == *other
}
}
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(BitRead, BitWrite, PartialEq, Eq, Hash, Debug, Serialize, Deserialize, Clone, Display)]
pub struct ServerClassName(String);
@ -73,6 +79,26 @@ impl From<&str> for ServerClassName {
}
}
impl PartialEq<&str> for ServerClassName {
fn eq(&self, other: &&str) -> bool {
self.as_str() == *other
}
}
impl AsRef<str> for ServerClassName {
fn as_ref(&self) -> &str {
self.0.as_ref()
}
}
impl Deref for ServerClassName {
type Target = str;
fn deref(&self) -> &Self::Target {
self.0.deref()
}
}
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(BitRead, BitWrite, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ServerClass {