Skip to content

Commit

Permalink
chore: small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ten3roberts committed Jan 26, 2025
1 parent 0e02770 commit 1ec3483
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 12 deletions.
14 changes: 12 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions violet-core/src/assets/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ impl<T: ?Sized> std::ops::Deref for Asset<T> {
}
}

impl AsRef<[u8]> for Asset<Vec<u8>> {
fn as_ref(&self) -> &[u8] {
&**self

Check warning on line 78 in violet-core/src/assets/handle.rs

View workflow job for this annotation

GitHub Actions / Clippy

deref which would be done by auto-deref

Check warning on line 78 in violet-core/src/assets/handle.rs

View workflow job for this annotation

GitHub Actions / Clippy

deref which would be done by auto-deref
}
}

impl<T: ?Sized> Clone for Asset<T> {
fn clone(&self) -> Self {
Self {
Expand Down
12 changes: 6 additions & 6 deletions violet-core/src/style/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ impl ColorPalette {
element_disabled_success: PLATINUM_950,
element_disabled_warning: PLATINUM_950,
//
surface_success: EMERALD_400,
surface_warning: CITRUS_400,
surface_danger: RUBY_400,
element_success: EMERALD_950,
element_warning: CITRUS_950,
element_danger: RUBY_950,
surface_success: EMERALD_500,
surface_warning: CITRUS_500,
surface_danger: RUBY_500,
element_success: element_primary,
element_warning: element_primary,
element_danger: element_primary,
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions violet-core/src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{

use atomic_refcell::AtomicRefCell;
use flax::{
archetype::Storage,
archetype::ArchetypeStorage,
component::ComponentValue,
components::child_of,
entity_ids,
Expand Down Expand Up @@ -135,7 +135,7 @@ impl QueryInvalidator {
}

impl EventSubscriber for QueryInvalidator {
fn on_added(&self, _: &Storage, event: &EventData) {
fn on_added(&self, _: &ArchetypeStorage, event: &EventData) {
// tracing::info!(component = ?self.name_map[&event.key], ?event.ids, "added");
self.mark_dirty(event.ids);
}
Expand All @@ -145,7 +145,7 @@ impl EventSubscriber for QueryInvalidator {
self.mark_dirty(event.ids);
}

fn on_removed(&self, _: &Storage, event: &EventData) {
fn on_removed(&self, _: &ArchetypeStorage, event: &EventData) {
// tracing::info!(component = ?self.name_map[&event.key], ?event.ids, "removed");
self.mark_dirty(event.ids);
}
Expand Down
3 changes: 2 additions & 1 deletion violet-wgpu/src/renderer/rect_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ use palette::Srgba;
use violet_core::{
assets::{map::HandleMap, Asset, AssetCache, AssetKey},
components::{
anchor, color, widget_corner_radius, draw_shape, image, rect, screen_clip_mask, screen_transform,
anchor, color, draw_shape, image, rect, screen_clip_mask, screen_transform,
widget_corner_radius,
},
shape::{self, shape_rectangle},
stored::{self, WeakHandle},
Expand Down

0 comments on commit 1ec3483

Please sign in to comment.