mirror of
https://github.com/mbilker/kbinxml-rs.git
synced 2026-04-25 15:42:45 -05:00
error: add Send + Sync trait bounds on StringParse error container
This commit is contained in:
parent
a840cc63fa
commit
60a05c00b8
|
|
@ -76,7 +76,7 @@ pub enum KbinError {
|
|||
#[snafu(display("Unable to interpret input as {}", node_type))]
|
||||
StringParse {
|
||||
node_type: &'static str,
|
||||
source: Box<dyn Error>,
|
||||
source: Box<dyn Error + Send + Sync>,
|
||||
},
|
||||
|
||||
#[snafu(display("Unable to interpret integer input as {}", node_type))]
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ fn space_check(input: &str) -> Result<()> {
|
|||
|
||||
fn parse_tuple<T>(node_type: &'static str, input: &str, output: &mut [T]) -> Result<()>
|
||||
where T: FromStr,
|
||||
T::Err: Error + 'static,
|
||||
T::Err: Error + Send + Sync + 'static,
|
||||
{
|
||||
let count = input.split(' ').count();
|
||||
if count != output.len() {
|
||||
|
|
@ -29,7 +29,9 @@ fn parse_tuple<T>(node_type: &'static str, input: &str, output: &mut [T]) -> Res
|
|||
}
|
||||
|
||||
for (i, part) in input.split(' ').enumerate() {
|
||||
output[i] = part.parse::<T>().map_err(|e| Box::new(e) as Box<dyn Error>).context(StringParse { node_type })?;
|
||||
output[i] = part.parse::<T>()
|
||||
.map_err(|e| Box::new(e) as Box<(dyn Error + Send + Sync + 'static)>)
|
||||
.context(StringParse { node_type })?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user