Skip to content

Commit

Permalink
done style
Browse files Browse the repository at this point in the history
  • Loading branch information
JieningYu committed Nov 11, 2023
1 parent 248e657 commit 1d1ec0d
Show file tree
Hide file tree
Showing 7 changed files with 352 additions and 109 deletions.
4 changes: 2 additions & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
rimecraft-primitives = { path = "../primitives", features = [
"serde",
"edcode"
"edcode",
] }
rimecraft-caches = { path = "../util/caches", features = ["arc"] }
rimecraft-collections = { path = "../util/collections", features = [
Expand All @@ -26,7 +26,7 @@ serde_json = "1.0"
toml = "0.8"
uuid = { version = "1.4", features = ["v3", "v4"] }
md-5 = "0.10"
url = "2.4"
url = { version = "2.4", features = ["serde"] }
sysinfo = "0.29"
bytes = "1.4"
glam = "0.24"
Expand Down
81 changes: 0 additions & 81 deletions core/src/text/click_event.rs

This file was deleted.

8 changes: 5 additions & 3 deletions core/src/text/hover_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::{
collections::HashMap,
fmt::Debug,
hash::{Hash, Hasher},
sync::Arc,
};

#[derive(thiserror::Error, Debug)]
Expand All @@ -28,8 +29,9 @@ rimecraft_primitives::update_trait_object!(UpdDebug);
/// # MCJE Reference
///
/// This type represents `net.minecraft.text.HoverEvent` (yarn).
#[derive(Clone)]
pub struct HoverEvent {
contents: Box<dyn UpdDebug + Send + Sync>,
contents: Arc<dyn UpdDebug + Send + Sync>,
action: &'static ErasedAction,
}

Expand All @@ -40,7 +42,7 @@ impl HoverEvent {
T: ErasedSerDeUpdate + Debug + Hash + Send + Sync + 'static,
{
Self {
contents: Box::new(contents),
contents: Arc::new(contents),
action: ErasedAction::from_name(action.name)
.ok_or(Error::ActionNotRegistered(action.name))
.unwrap(),
Expand Down Expand Up @@ -129,7 +131,7 @@ impl<'de> Deserialize<'de> for HoverEvent {
.map_err(D::Error::custom)?;

Ok(Self {
contents: contents_obj,
contents: contents_obj.into(),
action,
})
}
Expand Down
Loading

0 comments on commit 1d1ec0d

Please sign in to comment.