Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ dioxus-util = { path = "packages/util", version = "0.1.0-alpha.1" }
dioxus-window = { path = "packages/window", version = "0.1.0-alpha.1" }

# Dioxus
dioxus = "0.6.0"
dioxus-signals = "0.6.0"
dioxus-desktop = "0.6.0"
dioxus-config-macro = "0.6.0"
dioxus = "0.7.0-alpha.2"
dioxus-signals = "0.7.0-alpha.2"
dioxus-desktop = "0.7.0-alpha.2"
dioxus-config-macro = "0.7.0-alpha.2"

# Deps
cfg-if = "1.0.0"
Expand Down
4 changes: 4 additions & 0 deletions packages/storage/src/client_storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ macro_rules! set_dir {
#[cfg(not(target_family = "wasm"))]
$crate::set_directory(std::path::PathBuf::from($path))
};
($path:expr) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than having an expr to be used freely on set_directory, why not just extend the current $path:literal to use an expr?

Something like

    ($path: expr) => {
        #[cfg(not(target_family = "wasm"))]
        $crate::storage::set_directory(std::path::PathBuf::from(format!("{}", $path)))
    };

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it force users to do dioxus_storage::set_dir!(path.display()); ?

Copy link
Member

@ealmloff ealmloff Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::path::PathBuf::from($path) should work with Paths, PathBufs and &strs

#[cfg(not(target_family = "wasm"))]
$crate::set_directory($path);
};
}

cfg_if::cfg_if! {
Expand Down
Loading