task wrappers tooling workaround

[?]
Jul 30, 2025, 5:48 PM
7MJOO4E2VGNT7FKBOJUX6JDG4OET6V7DH3JIERUQXXJPM2AJQCNQC

Dependencies

Change contents

  • replacement in justfile at line 31
    [2.363][7.52:82]()
    cargo +{{nightly}} clippy
    [2.363]
    [2.380]
    cargo +{{nightly}} clippy --all-targets
  • replacement in inflorescence/src/main.rs at line 50
    [5.66][8.17920:17983](),[8.17983][5.127:195](),[5.127][5.127:195]()
    let repo_path = PathBuf::from("/home/tz/dev/pj-test");
    iced::daemon(move || init(repo_path.clone()), update, view)
    [5.66]
    [5.195]
    let repo_path = PathBuf::from("/home/tz/dev/pijul");
    iced_utils::daemon(move || init(repo_path.clone()), update, view)
  • edit in iced_utils/src/lib.rs at line 1
    [6.11236]
    [6.11237]
    mod daemon_wrapper;
  • edit in iced_utils/src/lib.rs at line 5
    [6.11267]
    [6.11267]
    pub use daemon_wrapper::daemon;
    #[doc(inline)]
  • file addition: daemon_wrapper.rs (----------)
    [6.9333]
    /// Wrapper for `iced::daemon`.
    ///
    /// This is a workaround for `clippy --all-target` and rust-analyzer issue that
    /// happens when this crate is used with `"testing"` feature enabled in
    /// dev-dependencies. These tools then "leak" the `"testing"` feature into
    /// checks of non-test code.
    ///
    /// This is unfortunately quite involved due to all the stuff it requires (see
    /// `dependencies` below).
    pub fn daemon<State, Message, Theme, Renderer>(
    boot: impl Boot<State, Message>,
    update: impl Update<State, Message>,
    view: impl for<'a> iced::daemon::View<'a, State, Message, Theme, Renderer>,
    ) -> Daemon<impl Program<State = State, Message = Message, Theme = Theme>>
    where
    State: 'static,
    Message: iced_program::Message + 'static,
    Theme: Default + iced::theme::Base,
    Renderer: iced_program::Renderer,
    {
    #[cfg(not(any(test, feature = "testing")))]
    {
    iced::daemon(boot, update, view)
    }
    #[cfg(any(test, feature = "testing"))]
    {
    let _ = (boot, update, view);
    Daemon {
    _raw: DummyProgram {
    phantom: std::marker::PhantomData,
    },
    }
    }
    }
    pub use depedencies::*;
    #[cfg(not(any(test, feature = "testing")))]
    mod depedencies {
    pub use iced::application::{Boot, Update};
    pub use iced::{Daemon, Program};
    }
    #[cfg(any(test, feature = "testing"))]
    mod depedencies {
    pub trait Boot<State, Message> {}
    #[cfg(any(test, feature = "testing"))]
    impl<T, State, Message> Boot<State, Message> for T {}
    #[cfg(any(test, feature = "testing"))]
    pub trait Update<State, Message> {}
    #[cfg(any(test, feature = "testing"))]
    impl<T, State, Message> Update<State, Message> for T {}
    #[cfg(any(test, feature = "testing"))]
    pub trait Program {
    type State;
    type Message;
    type Theme;
    }
    #[cfg(any(test, feature = "testing"))]
    pub struct Daemon<P: Program> {
    pub _raw: P,
    }
    #[cfg(any(test, feature = "testing"))]
    pub struct DummyProgram<State, Message, Theme> {
    pub phantom: std::marker::PhantomData<(State, Message, Theme)>,
    }
    #[cfg(any(test, feature = "testing"))]
    impl<State, Message, Theme> Program for DummyProgram<State, Message, Theme> {
    type State = State;
    type Message = Message;
    type Theme = Theme;
    }
    #[cfg(any(test, feature = "testing"))]
    impl<P: Program> Daemon<P> {
    pub fn subscription(
    self,
    f: impl Fn(&P::State) -> iced::Subscription<P::Message>,
    ) -> Daemon<P> {
    let _ = (self, f);
    unimplemented!()
    }
    pub fn theme(
    self,
    f: impl Fn(&P::State, iced::window::Id) -> P::Theme,
    ) -> Daemon<P> {
    let _ = (self, f);
    unimplemented!()
    }
    pub fn title(
    self,
    title: impl iced::daemon::Title<P::State>,
    ) -> Daemon<P> {
    let _ = (self, title);
    unimplemented!()
    }
    pub fn run(self) -> iced::Result
    where
    Self: 'static,
    {
    let _ = self;
    unimplemented!()
    }
    }
    }
  • edit in iced_utils/Cargo.toml at line 14
    [6.11536]
    [6.11536]
    workspace = true
    [dependencies.iced_program]
  • edit in Cargo.toml at line 45
    [3.1060]
    [4.29313]
    [workspace.dependencies.iced_program]
    git = "https://github.com/iced-rs/iced"
    rev = "c952ea8485b00e58bdff153989f708553272e131"
    # path = "../iced/program"
  • edit in Cargo.lock at line 2111
    [6.14906]
    [6.14906]
    "iced_program",