parent
1fc46923ef
commit
fd5a606b19
1 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
//! The default loader.
|
//! The default loader.
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
use std::{collections::BTreeMap, sync::Arc};
|
||||||
|
|
||||||
use hashlink::LinkedHashMap;
|
use hashlink::LinkedHashMap;
|
||||||
use saphyr_parser::{Event, MarkedEventReceiver, Marker, ScanError, TScalarStyle, Tag};
|
use saphyr_parser::{Event, MarkedEventReceiver, Marker, ScanError, TScalarStyle, Tag};
|
||||||
|
@ -172,10 +172,10 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An error that happened when loading a YAML document.
|
/// An error that happened when loading a YAML document.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum LoadError {
|
pub enum LoadError {
|
||||||
/// An I/O error.
|
/// An I/O error.
|
||||||
IO(std::io::Error),
|
IO(Arc<std::io::Error>),
|
||||||
/// An error within the scanner. This indicates a malformed YAML input.
|
/// An error within the scanner. This indicates a malformed YAML input.
|
||||||
Scan(ScanError),
|
Scan(ScanError),
|
||||||
/// A decoding error (e.g.: Invalid UTF-8).
|
/// A decoding error (e.g.: Invalid UTF-8).
|
||||||
|
@ -184,7 +184,7 @@ pub enum LoadError {
|
||||||
|
|
||||||
impl From<std::io::Error> for LoadError {
|
impl From<std::io::Error> for LoadError {
|
||||||
fn from(error: std::io::Error) -> Self {
|
fn from(error: std::io::Error) -> Self {
|
||||||
LoadError::IO(error)
|
LoadError::IO(Arc::new(error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue