Skip to content

Commit

Permalink
add few suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Shourya742 committed Jan 14, 2025
1 parent 89e0c58 commit e14205f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion utils/sv2_serde_json/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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
1 change: 0 additions & 1 deletion utils/sv2_serde_json/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,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 61 in utils/sv2_serde_json/src/token.rs

View check run for this annotation

Codecov / codecov/patch

utils/sv2_serde_json/src/token.rs#L57-L61

Added lines #L57 - L61 were not covered by tests

let _ = self.iterator.next();

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

View check run for this annotation

Codecov / codecov/patch

utils/sv2_serde_json/src/token.rs#L63

Added line #L63 was not covered by tests
Expand Down
3 changes: 1 addition & 2 deletions utils/sv2_serde_json/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub enum Value {
Array(Vec<Value>),
Object(HashMap<String, Value>),
Null,
None,
None,
Some(Box<Value>),
}

Expand Down Expand Up @@ -58,7 +58,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 e14205f

Please sign in to comment.