Skip to content

Commit

Permalink
chore(docs): cleanup examples
Browse files Browse the repository at this point in the history
Apply nightly clippy fixes
  • Loading branch information
jeertmans committed Feb 20, 2024
1 parent 81f923c commit a533045
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ enum Value {

/* ANCHOR: value */
/// Parse a token stream into a JSON value.
fn parse_value<'source>(lexer: &mut Lexer<'source, Token>) -> Result<Value> {
fn parse_value(lexer: &mut Lexer<'_, Token>) -> Result<Value> {
if let Some(token) = lexer.next() {
match token {
Ok(Token::Bool(b)) => Ok(Value::Bool(b)),
Expand All @@ -110,7 +110,7 @@ fn parse_value<'source>(lexer: &mut Lexer<'source, Token>) -> Result<Value> {
/// a valid terminator is found.
///
/// > NOTE: we assume '[' was consumed.
fn parse_array<'source>(lexer: &mut Lexer<'source, Token>) -> Result<Value> {
fn parse_array(lexer: &mut Lexer<'_, Token>) -> Result<Value> {
let mut array = Vec::new();
let span = lexer.span();
let mut awaits_comma = false;
Expand Down Expand Up @@ -164,7 +164,7 @@ fn parse_array<'source>(lexer: &mut Lexer<'source, Token>) -> Result<Value> {
/// a valid terminator is found.
///
/// > NOTE: we assume '{' was consumed.
fn parse_object<'source>(lexer: &mut Lexer<'source, Token>) -> Result<Value> {
fn parse_object(lexer: &mut Lexer<'_, Token>) -> Result<Value> {
let mut map = HashMap::new();
let span = lexer.span();
let mut awaits_comma = false;
Expand Down Expand Up @@ -217,7 +217,7 @@ fn main() {
let a = colors.next();

Report::build(ReportKind::Error, &filename, 12)
.with_message(format!("Invalid JSON"))
.with_message("Invalid JSON".to_string())
.with_label(
Label::new((&filename, span))
.with_message(msg)
Expand Down
2 changes: 1 addition & 1 deletion examples/json_borrowed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ fn main() {
let a = colors.next();

Report::build(ReportKind::Error, &filename, 12)
.with_message(format!("Invalid JSON"))
.with_message("Invalid JSON".to_string())
.with_label(
Label::new((&filename, span))
.with_message(msg)
Expand Down

0 comments on commit a533045

Please sign in to comment.