fix: Remove static-rc due to debug assertions
This commit is contained in:
parent
9796fa9f15
commit
d13415713c
4 changed files with 3 additions and 13 deletions
|
|
@ -22,7 +22,6 @@ lazy_static = "1.4.0"
|
||||||
palette = "0.6.1"
|
palette = "0.6.1"
|
||||||
cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", default-features = false, optional = true }
|
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 }
|
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", optional = true }
|
||||||
static-rc = "0.6.1"
|
|
||||||
|
|
||||||
[dependencies.cosmic-theme]
|
[dependencies.cosmic-theme]
|
||||||
git = "https://github.com/pop-os/cosmic-theme.git"
|
git = "https://github.com/pop-os/cosmic-theme.git"
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@ pub mod widget;
|
||||||
mod ext;
|
mod ext;
|
||||||
pub use ext::ElementExt;
|
pub use ext::ElementExt;
|
||||||
|
|
||||||
mod utils;
|
|
||||||
|
|
||||||
pub use theme::Theme;
|
pub use theme::Theme;
|
||||||
pub type Renderer = iced::Renderer<Theme>;
|
pub type Renderer = iced::Renderer<Theme>;
|
||||||
pub type Element<'a, Message> = iced::Element<'a, Message, Renderer>;
|
pub type Element<'a, Message> = iced::Element<'a, Message, Renderer>;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
// Copyright 2022 System76 <info@system76.com>
|
|
||||||
// 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<T>(value: T) -> (StaticRc<T, 1, 3>, StaticRc<T, 2, 3>) {
|
|
||||||
StaticRc::split::<1, 2>(StaticRc::<T, 3, 3>::new(value))
|
|
||||||
}
|
|
||||||
|
|
@ -9,6 +9,7 @@ use iced::{
|
||||||
};
|
};
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
|
use std::rc::Rc;
|
||||||
use derive_setters::Setters;
|
use derive_setters::Setters;
|
||||||
use crate::{Element, Renderer};
|
use crate::{Element, Renderer};
|
||||||
|
|
||||||
|
|
@ -57,7 +58,8 @@ pub fn icon<'a>(name: impl Into<Cow<'a, str>>, size: u16) -> Icon<'a> {
|
||||||
impl<'a> Icon<'a> {
|
impl<'a> Icon<'a> {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
fn into_svg<Message: 'static>(self) -> Element<'a, Message> {
|
fn into_svg<Message: 'static>(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<Message> {
|
iced_lazy::lazy(svg_clone, move || -> Element<Message> {
|
||||||
let icon = freedesktop_icons::lookup(&svg.name)
|
let icon = freedesktop_icons::lookup(&svg.name)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue