Skip to content

Commit

Permalink
remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Shourya742 committed Jan 14, 2025
1 parent 89e0c58 commit ede3466
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion utils/sv2_serde_json/src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::result_unit_err)]
use std::{
collections::HashMap,
fs::File,
Expand All @@ -15,7 +16,7 @@ use crate::{
pub struct JsonParser;

impl JsonParser {
pub fn parse_from_bytes<'a>(input: &'a [u8]) -> Result<Value, ()> {
pub fn parse_from_bytes(input: &[u8]) -> Result<Value, ()> {
let mut json_tokenizer = Jsontokensizer::<BufReader<Cursor<&[u8]>>>::from_bytes(input);
let tokens = json_tokenizer.tokensize_json()?;
Ok(Self::tokens_to_value(tokens))
Expand Down
2 changes: 1 addition & 1 deletion utils/sv2_serde_json/src/token.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::result_unit_err)]
use std::{
fs::File,
io::{BufReader, Cursor, Read, Seek},
Expand Down Expand Up @@ -58,7 +59,6 @@ where
while let Some(character) = self.iterator.peek() {
match *character {
'"' => {
// Pushed opening quote to output tokens list.
self.tokens.push(Token::Quotes);

Check warning on line 62 in utils/sv2_serde_json/src/token.rs

View check run for this annotation

Codecov / codecov/patch

utils/sv2_serde_json/src/token.rs#L58-L62

Added lines #L58 - L62 were not covered by tests

let _ = self.iterator.next();

Check warning on line 64 in utils/sv2_serde_json/src/token.rs

View check run for this annotation

Codecov / codecov/patch

utils/sv2_serde_json/src/token.rs#L64

Added line #L64 was not covered by tests
Expand Down
4 changes: 2 additions & 2 deletions utils/sv2_serde_json/src/value.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::result_unit_err)]
use std::collections::HashMap;

#[derive(Debug, Copy, Clone, PartialEq)]
Expand All @@ -14,7 +15,7 @@ pub enum Value {
Array(Vec<Value>),
Object(HashMap<String, Value>),
Null,
None,
None,
Some(Box<Value>),
}

Expand Down Expand Up @@ -58,7 +59,6 @@ pub trait FromJsonValue: Sized {
fn from_json_value(value: &Value) -> Result<Self, ()>;
}


impl ToJsonValue for String {
fn to_json_value(&self) -> Value {
Value::String(self.clone())
Expand Down

0 comments on commit ede3466

Please sign in to comment.