Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "minimal-yaml"
version = "0.1.5"
authors = ["Nathan Whitaker <nathan.whitaker01@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "A minimalist, zero-copy parser for a strict subset of the YAML specification."
readme = "README.md"
Expand Down
11 changes: 1 addition & 10 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ use std::str::Bytes;

use crate::Result;

// Implementation lifted from std, as it's currently only on Nightly. It's such a simple macro that it's low risk to duplicate it here (and better than writing one myself)
macro_rules! matches {
($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )?) => {
match $expression {
$( $pattern )|+ $( if $guard )? => true,
_ => false
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum ParseContext {
FlowIn,
Expand Down Expand Up @@ -210,7 +201,7 @@ impl<'a, 'b> Parser<'a> {
}
b'-' => match self.peek() {
Some(byt) if byt.is_linebreak() || byt.is_ws() => self.parse_sequence_block()?,
byt => unreachable!(format!("unexpected {:?}", byt.map(char::from))),
byt => unreachable!("unexpected {:?}", byt.map(char::from)),
},

b'}' | b']' => {
Expand Down