mirror of
https://github.com/simonask/libyaml-safer
synced 2024-11-10 05:44:17 +00:00
Minor reorganization
This commit is contained in:
parent
6f7b184678
commit
2bff17e0b8
3 changed files with 19 additions and 15 deletions
18
src/error.rs
18
src/error.rs
|
@ -1,4 +1,20 @@
|
|||
use crate::Mark;
|
||||
/// The pointer position.
|
||||
#[derive(Copy, Clone, Default, Debug)]
|
||||
#[non_exhaustive]
|
||||
pub struct Mark {
|
||||
/// The position index.
|
||||
pub index: u64,
|
||||
/// The position line.
|
||||
pub line: u64,
|
||||
/// The position column.
|
||||
pub column: u64,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for Mark {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "line {} column {}", self.line, self.column)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum EmitterError {
|
||||
|
|
|
@ -64,7 +64,7 @@ pub use crate::scanner::yaml_parser_scan;
|
|||
pub use crate::writer::yaml_emitter_flush;
|
||||
pub use crate::yaml::{
|
||||
AliasData, Break, Document, Emitter, EmitterState, Encoding, Event, EventData, MappingStyle,
|
||||
Mark, Node, NodeItem, NodePair, Parser, ParserState, ScalarStyle, SequenceStyle, SimpleKey,
|
||||
Node, NodeItem, NodePair, Parser, ParserState, ScalarStyle, SequenceStyle, SimpleKey,
|
||||
TagDirective, Token, TokenData, VersionDirective,
|
||||
};
|
||||
#[doc(hidden)]
|
||||
|
|
14
src/yaml.rs
14
src/yaml.rs
|
@ -2,7 +2,7 @@ use alloc::collections::VecDeque;
|
|||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use crate::{api::yaml_parser_new, yaml_emitter_new};
|
||||
use crate::{api::yaml_parser_new, yaml_emitter_new, Mark};
|
||||
|
||||
pub use self::Encoding::*;
|
||||
|
||||
|
@ -81,18 +81,6 @@ pub enum Break {
|
|||
CrLn = 3,
|
||||
}
|
||||
|
||||
/// The pointer position.
|
||||
#[derive(Copy, Clone, Default, Debug)]
|
||||
#[non_exhaustive]
|
||||
pub struct Mark {
|
||||
/// The position index.
|
||||
pub index: u64,
|
||||
/// The position line.
|
||||
pub line: u64,
|
||||
/// The position column.
|
||||
pub column: u64,
|
||||
}
|
||||
|
||||
/// Scalar styles.
|
||||
#[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
|
||||
#[non_exhaustive]
|
||||
|
|
Loading…
Reference in a new issue