git.delta.rocks / jrsonnet / refs/commits / 3b19e49816fb

difftreelog

feat(evaluator) anyhow integration

Yaroslav Bolyukin2021-01-28parent: #f91abe0.patch.diff
in: master

3 files changed

modifiedCargo.lockdiffbeforeafterboth
10 "yansi-term",10 "yansi-term",
11]11]
12
13[[package]]
14name = "anyhow"
15version = "1.0.38"
16source = "registry+https://github.com/rust-lang/crates.io-index"
17checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1"
1218
13[[package]]19[[package]]
14name = "atty"20name = "atty"
163version = "0.3.4"169version = "0.3.4"
164dependencies = [170dependencies = [
165 "annotate-snippets",171 "annotate-snippets",
172 "anyhow",
166 "base64",173 "base64",
167 "bincode",174 "bincode",
168 "closure",175 "closure",
modifiedcrates/jrsonnet-evaluator/Cargo.tomldiffbeforeafterboth
17faster = []17faster = []
18# Rustc-like trace visualization18# Rustc-like trace visualization
19explaining-traces = ["annotate-snippets"]19explaining-traces = ["annotate-snippets"]
20# Allows library authors to throw custom errors
21anyhow-error = ["anyhow"]
2022
21# Unlocks extra features, but works only on unstable23# Unlocks extra features, but works only on unstable
22unstable = []24unstable = []
3739
38thiserror = "1.0"40thiserror = "1.0"
3941
40# Serialized stdlib42[dependencies.anyhow]
43version = "1.0"
44optional = true
45
46# Serialized stdlib
41[dependencies.serde]47[dependencies.serde]
42version = "1.0"48version = "1.0"
43optional = true49optional = true
modifiedcrates/jrsonnet-evaluator/src/error.rsdiffbeforeafterboth
124 #[error("sort error: {0}")]124 #[error("sort error: {0}")]
125 Sort(#[from] SortError),125 Sort(#[from] SortError),
126
127 #[cfg(feature = "anyhow-error")]
128 #[error(transparent)]
129 Other(Rc<anyhow::Error>)
126}130}
131
132#[cfg(feature = "anyhow-error")]
133impl From<anyhow::Error> for LocError {
134 fn from(e: anyhow::Error) -> Self {
135 Self::new(Error::Other(Rc::new(e)))
136 }
137}
138
127impl From<Error> for LocError {139impl From<Error> for LocError {
128 fn from(e: Error) -> Self {140 fn from(e: Error) -> Self {