Fix warnings.

This commit is contained in:
Ethiraric 2024-06-13 22:05:43 +02:00
parent 777fdaa17d
commit c3d83fbfe1
4 changed files with 8 additions and 7 deletions

View file

@ -54,7 +54,7 @@ pub enum Event {
/// The anchor ID the alias refers to.
usize,
),
/// Value, style, anchor_id, tag
/// Value, style, `anchor_id`, tag
Scalar(String, TScalarStyle, usize, Option<Tag>),
/// The start of a YAML sequence (array).
SequenceStart(

View file

@ -313,6 +313,7 @@ struct Indent {
/// consume/push a character. As of now, almost all lookaheads are 4 characters maximum, except:
/// - Escape sequences parsing: some escape codes are 8 characters
/// - Scanning indent in scalars: this looks ahead `indent + 2` characters
///
/// This constant must be set to at least 8. When scanning indent in scalars, the lookahead is done
/// in a single call if and only if the indent is `BUFFER_LEN - 2` or less. If the indent is higher
/// than that, the code will fall back to a loop of lookaheads.
@ -1140,12 +1141,12 @@ impl<T: Iterator<Item = char>> Scanner<T> {
self.scan_tag_shorthand_suffix(false, is_secondary_handle, "", &start_mark)?;
} else {
suffix = self.scan_tag_shorthand_suffix(false, false, &handle, &start_mark)?;
handle = "!".to_owned();
"!".clone_into(&mut handle);
// A special case: the '!' tag. Set the handle to '' and the
// suffix to '!'.
if suffix.is_empty() {
handle.clear();
suffix = "!".to_owned();
"!".clone_into(&mut suffix);
}
}
}

View file

@ -5,7 +5,7 @@ extern crate saphyr_parser;
use saphyr_parser::{Event, EventReceiver, Parser, TScalarStyle};
// These names match the names used in the C++ test suite.
#[cfg_attr(feature = "cargo-clippy", allow(clippy::enum_variant_names))]
#[allow(clippy::enum_variant_names)]
#[derive(Clone, PartialEq, PartialOrd, Debug)]
enum TestEvent {
OnDocumentStart,

View file

@ -1,11 +1,11 @@
use std::env;
use std::fs::File;
use std::io::prelude::*;
use saphyr_parser::{
parser::{MarkedEventReceiver, Parser},
scanner::Marker,
Event,
};
use std::env;
use std::fs::File;
use std::io::prelude::*;
/// A sink which discards any event sent.
struct NullSink {}