diff --git a/Cargo.toml b/Cargo.toml index c98e425f..ce06f64b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,6 @@ lazy_static = "1.4.0" palette = "0.6.1" cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", default-features = false, optional = true } sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", optional = true } -static-rc = "0.6.1" [dependencies.cosmic-theme] git = "https://github.com/pop-os/cosmic-theme.git" diff --git a/src/lib.rs b/src/lib.rs index 705510fc..402ac775 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,8 +17,6 @@ pub mod widget; mod ext; pub use ext::ElementExt; -mod utils; - pub use theme::Theme; pub type Renderer = iced::Renderer; pub type Element<'a, Message> = iced::Element<'a, Message, Renderer>; diff --git a/src/utils.rs b/src/utils.rs deleted file mode 100644 index 6bcfaaff..00000000 --- a/src/utils.rs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2022 System76 -// SPDX-License-Identifier: MPL-2.0 - -use static_rc::StaticRc; - -/// Uses [`StaticRc`] to create two halves of value with shared ownership, with no runtime reference counting required. -pub(crate) fn static_rc_halves(value: T) -> (StaticRc, StaticRc) { - StaticRc::split::<1, 2>(StaticRc::::new(value)) -} \ No newline at end of file diff --git a/src/widget/icon.rs b/src/widget/icon.rs index df9f76a6..0d5311c1 100644 --- a/src/widget/icon.rs +++ b/src/widget/icon.rs @@ -9,6 +9,7 @@ use iced::{ }; use std::borrow::Cow; use std::hash::Hash; +use std::rc::Rc; use derive_setters::Setters; use crate::{Element, Renderer}; @@ -57,7 +58,8 @@ pub fn icon<'a>(name: impl Into>, size: u16) -> Icon<'a> { impl<'a> Icon<'a> { #[must_use] fn into_svg(self) -> Element<'a, Message> { - let (svg, svg_clone) = crate::utils::static_rc_halves(self); + let svg = Rc::new(self); + let svg_clone = Rc::clone(&svg); iced_lazy::lazy(svg_clone, move || -> Element { let icon = freedesktop_icons::lookup(&svg.name)