Skip to content

Commit f27edc5

Browse files
authored
deps: remove derive_more and heck (#17)
## Description `derive_more` is not needed for the single place where it was used, and `heck` was unused. ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
1 parent 782e6bd commit f27edc5

File tree

4 files changed

+15
-41
lines changed

4 files changed

+15
-41
lines changed

Cargo.lock

Lines changed: 1 addition & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "n0-error"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition = "2024"
55
readme = "README.md"
66
description = "ergonomic errors with call-site location"
@@ -11,7 +11,6 @@ keywords = ["error", "location", "ergonomic"]
1111

1212
[dependencies]
1313
anyhow = { version = "1.0.100", optional = true }
14-
derive_more = { version = "2.0.1", features = ["debug", "display"] }
1514
n0-error-macros = { path = "n0-error-macros", version = "0.1.0" }
1615
spez = "0.1.2"
1716

n0-error-macros/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ keywords = ["error", "location", "ergonomic"]
1212
proc-macro = true
1313

1414
[dependencies]
15-
heck = "0.5"
1615
proc-macro2 = "1"
1716
quote = "1"
1817
syn = { version = "2", features = ["full", "extra-traits"] }

src/meta.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
use std::{fmt, sync::OnceLock};
22

33
/// Wrapper around `std::panic::Location` used for display in reports.
4-
#[derive(derive_more::Debug, derive_more::Display, Clone, Copy)]
5-
#[debug("{_0:?}")]
4+
#[derive(Clone, Copy)]
65
pub struct Location(&'static std::panic::Location<'static>);
76

7+
impl fmt::Display for Location {
8+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9+
fmt::Display::fmt(self.0, f)
10+
}
11+
}
12+
13+
impl fmt::Debug for Location {
14+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15+
fmt::Display::fmt(self.0, f)
16+
}
17+
}
18+
819
/// Captured metadata for an error creation site.
920
///
1021
/// Currently this only contains the call-site [`Location`].

0 commit comments

Comments
 (0)