Skip to content

Commit 39167e4

Browse files
committed
olpc-cjson: fix clippy warnings
1 parent a08e6c1 commit 39167e4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

olpc-cjson/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ impl CanonicalFormatter {
105105
/// Returns a mutable reference to the top of the object stack.
106106
fn obj_mut(&mut self) -> Result<&mut Object> {
107107
self.object_stack.last_mut().ok_or_else(|| {
108-
Error::new(
109-
ErrorKind::Other,
108+
Error::other(
110109
"serde_json called an object method without calling begin_object first",
111110
)
112111
})
@@ -229,8 +228,7 @@ impl Formatter for CanonicalFormatter {
229228

230229
fn end_object<W: Write + ?Sized>(&mut self, writer: &mut W) -> Result<()> {
231230
let object = self.object_stack.pop().ok_or_else(|| {
232-
Error::new(
233-
ErrorKind::Other,
231+
Error::other(
234232
"serde_json called Formatter::end_object object method
235233
without calling begin_object first",
236234
)

0 commit comments

Comments
 (0)