Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
novacrazy committed Oct 17, 2024
1 parent 83c52a3 commit 1e3817a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ bon = { version = "2", optional = true }
typed-builder = { version = "0.20", optional = true }
schemars = { version = "1.0.0-alpha.14", optional = true, features = ["triomphe01", "smol_str03", "thin-vec02"] }
okapi = { version = "0.7.0-rc.1", optional = true }
hashbrown = { version = "0.14", features = ["inline-more", "serde"] }

# Maybe?
# typescript-definitions = { git = "https://github.com/storyscript/typescript-definitions" }
Expand Down
2 changes: 1 addition & 1 deletion src/models/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ mod serde_impl {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
struct AuthTokenVisitor;

impl<'de> Visitor<'de> for AuthTokenVisitor {
impl Visitor<'_> for AuthTokenVisitor {
type Value = AuthToken;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion src/models/permission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const _: () = {

struct PermissionsVisitor;

impl<'de> de::Visitor<'de> for PermissionsVisitor {
impl de::Visitor<'_> for PermissionsVisitor {
type Value = Permissions;

fn expecting(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
Expand Down
5 changes: 4 additions & 1 deletion src/models/stats.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use super::*;

// TODO: no_std map of some kind
use std::collections::HashMap;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct Statistics {
pub rooms: hashbrown::HashMap<RoomId, RoomStatistics, FxRandomState2>,
pub rooms: HashMap<RoomId, RoomStatistics, FxRandomState2>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
4 changes: 1 addition & 3 deletions src/models/util/fixed_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const _: () = {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
struct FixedStrVisitor<const N: usize>(PhantomData<[(); N]>);

impl<'de, const N: usize> Visitor<'de> for FixedStrVisitor<N> {
impl<const N: usize> Visitor<'_> for FixedStrVisitor<N> {
type Value = FixedStr<N>;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -249,8 +249,6 @@ const _: () = {

#[cfg(feature = "schema")]
const _: () = {
extern crate alloc;

use alloc::{borrow::ToOwned, boxed::Box, string::String};

use schemars::{
Expand Down
2 changes: 1 addition & 1 deletion src/models/util/thin_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const _: () = {
{
struct ThinStringVisitor;

impl<'de> de::Visitor<'de> for ThinStringVisitor {
impl de::Visitor<'_> for ThinStringVisitor {
type Value = ThinString;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down

0 comments on commit 1e3817a

Please sign in to comment.