|
46 | 46 | //! ```rust |
47 | 47 | //! use std::io::{self, ErrorKind}; |
48 | 48 | //! |
49 | | -//! use masterror::{AppError, AppErrorKind}; |
| 49 | +//! use masterror::{AppError, AppErrorKind, AppResult}; |
50 | 50 | //! |
51 | | -//! fn open() -> Result<(), AppError> { |
| 51 | +//! fn open() -> AppResult<()> { |
52 | 52 | //! let _ = io::Error::new(ErrorKind::Other, "boom"); |
53 | 53 | //! Err(io::Error::from(ErrorKind::Other).into()) |
54 | 54 | //! } |
|
61 | 61 | //! feature): |
62 | 62 | //! |
63 | 63 | //! ```rust |
64 | | -//! use masterror::{AppError, AppErrorKind}; |
| 64 | +//! use masterror::{AppError, AppErrorKind, AppResult}; |
65 | 65 | //! |
66 | | -//! fn validate(x: i32) -> Result<(), AppError> { |
| 66 | +//! fn validate(x: i32) -> AppResult<()> { |
67 | 67 | //! if x < 0 { |
68 | 68 | //! return Err(String::from("must be non-negative").into()); |
69 | 69 | //! } |
@@ -149,9 +149,9 @@ impl From<IoError> for AppError { |
149 | 149 | /// Prefer structured validation for complex DTOs, but this covers simple cases. |
150 | 150 | /// |
151 | 151 | /// ```rust |
152 | | -/// use masterror::{AppError, AppErrorKind}; |
| 152 | +/// use masterror::{AppError, AppErrorKind, AppResult}; |
153 | 153 | /// |
154 | | -/// fn check(name: &str) -> Result<(), AppError> { |
| 154 | +/// fn check(name: &str) -> AppResult<()> { |
155 | 155 | /// if name.is_empty() { |
156 | 156 | /// return Err(String::from("name must not be empty").into()); |
157 | 157 | /// } |
|
0 commit comments