Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::error::Error;
- mod lua {
- use std::fmt;
- #[derive(Debug)]
- pub struct Error;
- impl fmt::Display for Error {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- f.write_str("Lua error")
- }
- }
- impl std::error::Error for Error {}
- }
- fn foo() -> Result<(), Box<dyn Error>> {
- bar()?;
- baz()?;
- Ok(())
- }
- fn bar() -> Result<(), url::ParseError> {
- Ok(())
- }
- fn baz() -> Result<(), lua::Error> {
- Ok(())
- }
Add Comment
Please, Sign In to add comment