Skip to content

Commit

Permalink
Make LoadError Clone.
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
Ethiraric committed Sep 25, 2024
1 parent d9d0f90 commit 2e8ebf5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/loader.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! The default loader.
use std::collections::BTreeMap;
use std::{collections::BTreeMap, sync::Arc};

use hashlink::LinkedHashMap;
use saphyr_parser::{Event, MarkedEventReceiver, Marker, ScanError, TScalarStyle, Tag};
Expand Down Expand Up @@ -172,10 +172,10 @@ where
}

/// An error that happened when loading a YAML document.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub enum LoadError {
/// An I/O error.
IO(std::io::Error),
IO(Arc<std::io::Error>),
/// An error within the scanner. This indicates a malformed YAML input.
Scan(ScanError),
/// A decoding error (e.g.: Invalid UTF-8).
Expand All @@ -184,7 +184,7 @@ pub enum LoadError {

impl From<std::io::Error> for LoadError {
fn from(error: std::io::Error) -> Self {
LoadError::IO(error)
LoadError::IO(Arc::new(error))
}
}

Expand Down

0 comments on commit 2e8ebf5

Please sign in to comment.