Remove derive_more and thiserror dependencies

This commit is contained in:
Nicolas Abril 2023-11-09 19:54:47 +01:00
parent 4894c8b64c
commit 27ff188477
3 changed files with 8 additions and 64 deletions

56
Cargo.lock generated
View File

@ -157,25 +157,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]]
name = "convert_case"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
[[package]]
name = "derive_more"
version = "0.99.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
dependencies = [
"convert_case",
"proc-macro2",
"quote",
"rustc_version",
"syn 1.0.109",
]
[[package]]
name = "diff"
version = "0.1.13"
@ -234,7 +215,6 @@ dependencies = [
"bimap",
"chumsky",
"clap",
"derive_more",
"hvm-core",
"indexmap",
"itertools 0.11.0",
@ -242,7 +222,6 @@ dependencies = [
"pretty_assertions",
"shrinkwraprs",
"stdext",
"thiserror",
"walkdir",
]
@ -361,15 +340,6 @@ version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "rustc_version"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [
"semver",
]
[[package]]
name = "same-file"
version = "1.0.6"
@ -379,12 +349,6 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "semver"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
[[package]]
name = "shrinkwraprs"
version = "0.3.0"
@ -445,26 +409,6 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "thiserror"
version = "1.0.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.38",
]
[[package]]
name = "unicode-ident"
version = "1.0.12"

View File

@ -22,13 +22,11 @@ anyhow = "1.0.72"
bimap = "0.6.3"
chumsky = "= 1.0.0-alpha.4"
clap = { version = "4.4.1", features = ["derive"], optional = true }
derive_more = "0.99.17"
hvm-core = { git = "https://github.com/HigherOrderCO/hvm-core.git" }
indexmap = "2.1.0"
itertools = "0.11.0"
logos = "0.13.0"
shrinkwraprs = "0.3.0"
thiserror = "1.0.49"
[dev-dependencies]
pretty_assertions = "1.4.0"

View File

@ -1,5 +1,4 @@
use bimap::{BiHashMap, Overwritten};
use derive_more::{Display, From, Into};
use hvmc::run::Val;
use indexmap::IndexMap;
use itertools::Itertools;
@ -154,15 +153,12 @@ pub struct Adt {
pub ctrs: IndexMap<Name, usize>,
}
#[derive(Debug, PartialEq, Eq, Clone, Shrinkwrap, Hash, PartialOrd, Ord, From, Into, Display)]
#[derive(Debug, PartialEq, Eq, Clone, Shrinkwrap, Hash, PartialOrd, Ord)]
pub struct Name(pub String);
#[derive(Debug, PartialEq, Eq, Clone, Copy, Shrinkwrap, Hash, PartialOrd, Ord, From, Into, Default)]
#[derive(Debug, PartialEq, Eq, Clone, Copy, Shrinkwrap, Hash, PartialOrd, Ord, Default)]
pub struct DefId(pub Val);
#[derive(Debug, PartialEq, Eq, Clone, Copy, Shrinkwrap, Hash, PartialOrd, Ord, From, Into)]
pub struct VarId(pub Val);
pub fn var_id_to_name(mut var_id: Val) -> Name {
let mut name = String::new();
loop {
@ -428,3 +424,9 @@ impl fmt::Display for Op {
}
}
}
impl fmt::Display for Name {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}