common_multipart_rfc7578/
error.rs

1// Copyright 2017 rust-multipart-rfc7578 Developers
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7//
8
9use std::io::Error as IoError;
10use thiserror::Error;
11
12#[derive(Debug, Error)]
13pub enum Error {
14    #[error("Failed to write multipart content: {0:?}")]
15    ContentRead(IoError),
16}
17
18impl From<Error> for IoError {
19    fn from(val: Error) -> Self {
20        match val {
21            Error::ContentRead(io) => io,
22        }
23    }
24}