chore: update derive_more to 1.0

This commit is contained in:
Wölfchen 2024-08-08 11:12:22 +02:00 committed by ElKowar
parent 4288771181
commit fdac6b5cd9
5 changed files with 33 additions and 25 deletions

22
Cargo.lock generated
View file

@ -599,12 +599,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "convert_case"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
[[package]]
name = "core-foundation-sys"
version = "0.8.6"
@ -760,15 +754,23 @@ dependencies = [
[[package]]
name = "derive_more"
version = "0.99.18"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce"
checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05"
dependencies = [
"derive_more-impl",
]
[[package]]
name = "derive_more-impl"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22"
dependencies = [
"convert_case",
"proc-macro2",
"quote",
"rustc_version",
"syn 2.0.72",
"unicode-xid",
]
[[package]]

View file

@ -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"

View file

@ -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,

View file

@ -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 {
@ -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 {

View file

@ -1,4 +1,4 @@
use derive_more::*;
use derive_more::{Debug, *};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use smart_default::SmartDefault;
@ -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),
}
@ -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,