Skip to content

Commit

Permalink
chore: update derive_more to 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
w-lfchen committed Aug 8, 2024
1 parent 0414663 commit 69924ed
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 25 deletions.
22 changes: 12 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ chrono-tz = "0.9.0"
clap = { version = "4.5.1", features = ["derive"] }
clap_complete = "4.5.12"
codespan-reporting = "0.11"
derive_more = "0.99"
derive_more = { version = "1", features = [
"as_ref",
"debug",
"display",
"from",
"from_str",
] }
extend = "1.2"
futures = "0.3.30"
grass = "0.13.4"
Expand Down
4 changes: 2 additions & 2 deletions crates/eww/src/geometry.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use derive_more::*;
use derive_more::{Debug, *};

#[derive(Debug, Copy, Clone, Eq, PartialEq, Display)]
#[display(fmt = ".x*.y:.width*.height")]
#[display(".x*.y:.width*.height")]
pub struct Rect {
pub x: i32,
pub y: i32,
Expand Down
10 changes: 5 additions & 5 deletions crates/eww_shared_util/src/wrappers.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use derive_more::*;
use derive_more::{Debug, *};
use ref_cast::RefCast;
use serde::{Deserialize, Serialize};

/// The name of a variable
#[repr(transparent)]
#[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize, AsRef, From, FromStr, Display, DebugCustom, RefCast)]
#[debug(fmt = "VarName({})", .0)]
#[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize, AsRef, From, FromStr, Display, Debug, RefCast)]
#[debug("VarName({})", _0)]
pub struct VarName(pub String);

impl std::borrow::Borrow<str> for VarName {
Expand Down Expand Up @@ -34,8 +34,8 @@ impl From<AttrName> for VarName {

/// The name of an attribute
#[repr(transparent)]
#[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize, AsRef, From, FromStr, Display, DebugCustom, RefCast)]
#[debug(fmt="AttrName({})", .0)]
#[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize, AsRef, From, FromStr, Display, Debug, RefCast)]
#[debug("AttrName({})", _0)]
pub struct AttrName(pub String);

impl AttrName {
Expand Down
14 changes: 7 additions & 7 deletions crates/yuck/src/value/coords.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use derive_more::*;
use derive_more::{Debug, *};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use smart_default::SmartDefault;
Expand All @@ -14,13 +14,13 @@ pub enum Error {
MalformedCoords,
}

#[derive(Clone, Copy, PartialEq, Deserialize, Serialize, Display, DebugCustom, SmartDefault)]
#[derive(Clone, Copy, PartialEq, Deserialize, Serialize, Display, Debug, SmartDefault)]
pub enum NumWithUnit {
#[display(fmt = "{}%", .0)]
#[debug(fmt = "{}%", .0)]
#[display("{}%", _0)]
#[debug("{}%", _0)]
Percent(f32),
#[display(fmt = "{}px", .0)]
#[debug(fmt = "{}px", .0)]
#[display("{}px", _0)]
#[debug("{}px", _0)]
#[default]
Pixels(i32),
}
Expand Down Expand Up @@ -58,7 +58,7 @@ impl FromStr for NumWithUnit {
}

#[derive(Clone, Copy, PartialEq, Deserialize, Serialize, Display, Default)]
#[display(fmt = "{}*{}", x, y)]
#[display("{}*{}", x, y)]
pub struct Coords {
pub x: NumWithUnit,
pub y: NumWithUnit,
Expand Down

0 comments on commit 69924ed

Please sign in to comment.