• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Grinkers / clojure-reader / 16771438556

06 Aug 2025 08:16AM UTC coverage: 97.157% (-0.6%) from 97.732%
16771438556

push

github

Grinkers
try

0 of 6 new or added lines in 2 files covered. (0.0%)

991 of 1020 relevant lines covered (97.16%)

120.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.73
/src/error.rs
1
use core::error;
2
use core::fmt::{self, Debug};
3

4
pub type Result<T> = core::result::Result<T, Error>;
5

6
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7
pub struct Error {
8
  /// Error code. This is `non_exhaustive`.
9
  pub code: Code,
10
  /// Line number, counting from 1.
11
  pub line: Option<usize>,
12
  /// Column number, counting from 1. The count is utf-8 chars.
13
  pub column: Option<usize>,
14
  /// This is a pointer offset of the str trying to be parsed, not a utf-8 char offset
15
  pub ptr: Option<usize>,
16
}
17

18
#[derive(Debug, Eq, PartialEq)]
19
#[non_exhaustive]
20
pub enum Code {
21
  /// Parse errors
22
  HashMapDuplicateKey,
23
  SetDuplicateKey,
24
  InvalidChar,
25
  InvalidEscape,
26
  InvalidKeyword,
27
  InvalidNumber,
28
  InvalidRadix(Option<u8>),
29
  UnexpectedEOF,
30
  UnmatchedDelimiter(char),
31

32
  /// Feature errors
33
  NoFloatFeature,
34

35
  /// Serde
36
  #[cfg(feature = "serde")]
37
  Serde(alloc::string::String),
38
}
39

40
impl error::Error for Error {}
41

42
impl Debug for Error {
43
  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
37✔
44
    write!(
37✔
45
      f,
37✔
46
      "EdnError {{ code: {:?}, line: {:?}, column: {:?}, ptr: {:?} }}",
37✔
47
      self.code, self.line, self.column, self.ptr
48
    )
49
  }
37✔
50
}
51

52
impl alloc::fmt::Display for Error {
53
  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1✔
54
    write!(f, "{self:?}")
1✔
55
  }
1✔
56
}
57

58
#[cfg(feature = "defmt")]
59
impl defmt::Format for Code {
NEW
60
  fn format(&self, fmt: defmt::Formatter<'_>) {
×
NEW
61
    defmt::write!(fmt, "Code({:?})", self);
×
NEW
62
  }
×
63
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc