You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
640B

  1. #![allow(unused_doc_comments)]
  2. #[macro_use]
  3. extern crate error_chain;
  4. extern crate image;
  5. extern crate syntect;
  6. extern crate tera;
  7. extern crate toml;
  8. error_chain! {
  9. errors {}
  10. links {
  11. Tera(tera::Error, tera::ErrorKind);
  12. }
  13. foreign_links {
  14. Io(::std::io::Error);
  15. Toml(toml::de::Error);
  16. Image(image::ImageError);
  17. Syntect(syntect::LoadingError);
  18. }
  19. }
  20. // So we can use bail! in all other crates
  21. #[macro_export]
  22. macro_rules! bail {
  23. ($e:expr) => {
  24. return Err($e.into());
  25. };
  26. ($fmt:expr, $($arg:tt)+) => {
  27. return Err(format!($fmt, $($arg)+).into());
  28. };
  29. }