MCPcopy Create free account
hub / github.com/chanced/jsonptr / invalid_encoding_len

Method invalid_encoding_len

src/pointer.rs:1194–1205  ·  view source on GitHub ↗

Length of the invalid encoding

(&self, subject: &str)

Source from the content-addressed store, hash-verified

1192 }
1193 /// Length of the invalid encoding
1194 pub fn invalid_encoding_len(&self, subject: &str) -> usize {
1195 match self {
1196 Self::NoLeadingSlash => 0,
1197 Self::InvalidEncoding { offset, .. } => {
1198 if *offset < subject.len() - 1 {
1199 2
1200 } else {
1201 1
1202 }
1203 }
1204 }
1205 }
1206}
1207
1208impl Diagnostic for ParseError {

Callers 1

labelsMethod · 0.80

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected