Skip to content
Merged
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
4 changes: 2 additions & 2 deletions packages/copper-proc-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pistonite-cu-proc-macros"
version = "0.2.5"
version = "0.2.6"
edition = "2024"
description = "Proc-macros for Cu"
repository = "https://github.com/Pistonite/cu"
Expand All @@ -12,7 +12,7 @@ exclude = [

[dependencies.pm]
package = "pistonite-pm"
version = "0.2.4"
version = "0.2.5"
path = "../promethium"
features = ["full"]

Expand Down
8 changes: 4 additions & 4 deletions packages/copper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pistonite-cu"
version = "0.7.1"
version = "0.7.2"
edition = "2024"
description = "Battery-included common utils to speed up development of rust tools"
repository = "https://github.com/Pistonite/cu"
Expand All @@ -11,14 +11,14 @@ exclude = [
]

[dependencies]
pistonite-cu-proc-macros = { version = "0.2.5", path = "../copper-proc-macros" }
pistonite-cu-proc-macros = { version = "0.2.6", path = "../copper-proc-macros" }

# --- Always enabled ---
anyhow = "1.0.100"
log = "0.4.29"

# --- Command Line Interface ---
oneshot = { version = "0.1.11", optional = true }
oneshot = { version = "0.1.12", optional = true }
env_filter = { version = "0.1.4", optional = true }
terminal_size = { version = "0.4.3", optional = true }
unicode-width = { version = "0.2.2", features = ["cjk"], optional = true }
Expand All @@ -36,7 +36,7 @@ tokio = { version = "1.49.0", optional = true, features = [
dunce = {version="1.0.5", optional = true}
which = {version = "8.0.0", optional = true }
pathdiff = {version = "0.2.3", optional=true}
filetime = { version = "0.2.26", optional = true}
filetime = { version = "0.2.27", optional = true}
glob = { version = "0.3.3", optional = true }
spin = {version = "0.10.0", optional = true} # for PIO

Expand Down
12 changes: 6 additions & 6 deletions packages/copper/src/errhand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ macro_rules! rethrow {
/// and return an error instead of panicking
#[macro_export]
macro_rules! unimplemented {
() => {
() => {{
$crate::trace!("unexpected: not implemented reached");
return $crate::Error::msg("not implemented");
};
return Err($crate::Error::msg("not implemented"));
}};
($($args:tt)*) => {{
let msg = format!("{}", format_args!($(args)*));
$crate::trace!("unexpected: not implemented reached: {msg}");
Expand All @@ -186,10 +186,10 @@ macro_rules! unimplemented {
/// This might be less performant in release builds
#[macro_export]
macro_rules! unreachable {
() => {
() => {{
$crate::trace!("unexpected: entered unreachable code");
return $crate::Error::msg("unreachable");
};
return Err($crate::Error::msg("unreachable"));
}};
($($args:tt)*) => {{
let msg = format!("{}", format_args!($(args)*));
$crate::trace!("unexpected: entered unreachable code: {msg}");
Expand Down
14 changes: 14 additions & 0 deletions packages/copper/src/process/pio/spinner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ impl Spinner {
pub fn debug(self) -> Self { self.config.lv.set(crate::lv::D); self }
/// Print any non-progress outputs as trace messages
pub fn trace(self) -> Self { self.config.lv.set(crate::lv::T); self }

/// Configure the progress bar that will be spawned
#[inline(always)]
pub fn configure_spinner<F: FnOnce(ProgressBarBuilder) -> ProgressBarBuilder>(
self,
f: F,
) -> Self {
let mut bar = self.config.bar.lock();
if let Err(builder) = bar.clone() {
*bar = Err(f(builder));
}
drop(bar);
self
}
}
struct SpinnerInner {
lv: Atomic<u8, Lv>,
Expand Down
6 changes: 3 additions & 3 deletions packages/promethium/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pistonite-pm"
version = "0.2.4"
version = "0.2.5"
edition = "2024"
description = "Procedural Macro Common Utils"
repository = "https://github.com/Pistonite/cu"
Expand All @@ -11,8 +11,8 @@ exclude = [
]

[dependencies]
proc-macro2 = { version = "1.0.105", default-features = false }
quote = { version = "1.0.43", default-features = false }
proc-macro2 = { version = "1.0.106", default-features = false }
quote = { version = "1.0.44", default-features = false }
syn = { version = "2.0.114", default-features = false }

[features]
Expand Down