#[macro_export]
macro_rules! display_as_debug {
{$x:ty} => {
+ impl Display for $x {
+ fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+ <Self as Debug>::fmt(self, f)
+ }
+ }
}
}
+pub use crate::display_as_debug;
BadNumber,
WriteFail,
}
+display_as_debug!{SVGProcessError}
impl From<fmt::Error> for SVGProcessError {
fn from(_: fmt::Error) -> Self { SVGProcessError::WriteFail }
}
-impl Display for SVGProcessError {
- fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
- <Self as Debug>::fmt(self, f)
- }
-}
#[throws(SVGProcessError)]
pub fn svg_rescale_path(input: &str, scale: f64) -> String {