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.

33 lines
578B

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