From ee89aa55d7ebe15e452fcdce810e897efa3373ef Mon Sep 17 00:00:00 2001 From: Tristan Druyen Date: Mon, 10 Feb 2025 13:33:56 +0100 Subject: [PATCH] refactor: Remove unused `frozen_llama` package - Remove `frozen_llama` directory and its files - Update `members` in `Cargo.toml` to exclude `frozen_llama` - Comment out unused `[workspace.dependencies]` and `[workspace.metadata.cargo-all-features]` sections --- Cargo.toml | 8 +++---- frozen_llama/Cargo.toml | 12 ---------- frozen_llama/README.md | 24 ------------------- frozen_llama/index.html | 12 ---------- frozen_llama/src/main.rs | 45 ------------------------------------ frozen_llama/src/markdown.rs | 39 ------------------------------- 6 files changed, 4 insertions(+), 136 deletions(-) delete mode 100644 frozen_llama/Cargo.toml delete mode 100644 frozen_llama/README.md delete mode 100644 frozen_llama/index.html delete mode 100644 frozen_llama/src/main.rs delete mode 100644 frozen_llama/src/markdown.rs diff --git a/Cargo.toml b/Cargo.toml index 21deb26..59479da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ lto = "fat" panic = "abort" [workspace] -members = ["frozen_llama", "llama_proxy_man", "redvault_el_rs", "garnix"] +members = ["llama_proxy_man", "redvault_el_rs", "garnix"] resolver = "2" [workspace.package] @@ -36,8 +36,8 @@ repository = "https://git.vlt81.de/oekonzept/oeko-mono" version = "0.1.1" edition = "2021" -[workspace.dependencies] +# [workspace.dependencies] # iced = { git = "https://github.com/iced-rs/iced.git", branch = "master" } -[workspace.metadata.cargo-all-features] -skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]] +# [workspace.metadata.cargo-all-features] +# skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]] diff --git a/frozen_llama/Cargo.toml b/frozen_llama/Cargo.toml deleted file mode 100644 index 9a9f1d8..0000000 --- a/frozen_llama/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "frozen_llama" -version.workspace=true -authors.workspace=true -edition.workspace=true -publish.workspace=true - -[dependencies] -iced = { version = "0.13", features = [ "markdown", "highlighter" ]} - -[target.'cfg(target_arch = "wasm32")'.dependencies] -iced = { version = "0.13", features = [ "markdown", "highlighter", "webgl" ]} diff --git a/frozen_llama/README.md b/frozen_llama/README.md deleted file mode 100644 index 18761bb..0000000 --- a/frozen_llama/README.md +++ /dev/null @@ -1,24 +0,0 @@ -## Counter - -The classic counter example explained in the [`README`](../../README.md). - -The __[`main`]__ file contains all the code of the example. - -
- -
- -You can run it with `cargo run`: -``` -cargo run --package counter -``` - -The web version can be run with [`trunk`]: - -``` -cd examples/counter -trunk serve -``` - -[`main`]: src/main.rs -[`trunk`]: https://trunkrs.dev/ diff --git a/frozen_llama/index.html b/frozen_llama/index.html deleted file mode 100644 index 749b158..0000000 --- a/frozen_llama/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Counter - Iced - - - - - - diff --git a/frozen_llama/src/main.rs b/frozen_llama/src/main.rs deleted file mode 100644 index e23942c..0000000 --- a/frozen_llama/src/main.rs +++ /dev/null @@ -1,45 +0,0 @@ -use iced::widget::{button, column, text, Column}; -use iced::Center; - -mod markdown; -use markdown::*; - -pub fn main() -> iced::Result { - let md = markdown::Markdown::new(); - // iced::run("A cool counter", Counter::update, Counter::view) - iced::run("", markdown::Markdown::update, markdown::Markdown::view) -} - -#[derive(Default)] -struct Counter { - value: i64, -} - -#[derive(Debug, Clone, Copy)] -enum Message { - Increment, - Decrement, -} - -impl Counter { - fn update(&mut self, message: Message) { - match message { - Message::Increment => { - self.value += 1; - } - Message::Decrement => { - self.value -= 1; - } - } - } - - fn view(&self) -> Column { - column![ - button("Increment").on_press(Message::Increment), - text(self.value).size(50), - button("Decrement").on_press(Message::Decrement), - ] - .padding(20) - .align_x(Center) - } -} diff --git a/frozen_llama/src/markdown.rs b/frozen_llama/src/markdown.rs deleted file mode 100644 index d76aabe..0000000 --- a/frozen_llama/src/markdown.rs +++ /dev/null @@ -1,39 +0,0 @@ -use iced::widget::markdown; -use iced::Element; -use iced::Theme; - -#[derive(Debug, Clone, Default)] -pub struct Markdown { - markdown: Vec, -} - -#[derive(Debug)] -pub enum Message { - LinkClicked(markdown::Url), -} - -impl Markdown { - pub fn new() -> Self { - Self { - markdown: markdown::parse("This is some **Markdown**!").collect(), - } - } - - pub fn view(&self) -> Element<'_, Message> { - markdown::view( - &self.markdown, - markdown::Settings::default(), - markdown::Style::from_palette(Theme::TokyoNightStorm.palette()), - ) - .map(Message::LinkClicked) - .into() - } - - pub fn update(_state: &mut Self, message: Message) { - match message { - Message::LinkClicked(url) => { - println!("The following url was clicked: {url}"); - } - } - } -}