Skip to content

Commit 788e431

Browse files
committed
Encountering an error is the cold path
1 parent 0048e76 commit 788e431

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/de.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,14 @@ impl<'de, R: Read<'de>> Deserializer<R> {
155155
}
156156

157157
/// Error caused by a byte from next_char().
158+
#[cold]
158159
fn error(&self, reason: ErrorCode) -> Error {
159160
let pos = self.read.position();
160161
Error::syntax(reason, pos.line, pos.column)
161162
}
162163

163164
/// Error caused by a byte from peek().
165+
#[cold]
164166
fn peek_error(&self, reason: ErrorCode) -> Error {
165167
let pos = self.read.peek_position();
166168
Error::syntax(reason, pos.line, pos.column)

0 commit comments

Comments
 (0)