1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use std::fmt;

#[macro_export]
macro_rules!live_error_origin{
    () => {
        LiveErrorOrigin { filename : file ! ( ) . to_string ( ) , line : line ! ( ) as usize }
    }
}

#[derive(Clone, Default, PartialEq)]
pub struct LiveErrorOrigin {
    pub filename: String,
    pub line:usize
}

impl fmt::Display for LiveErrorOrigin {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}:{} ", self.filename, self.line)
    }
}

impl fmt::Debug for LiveErrorOrigin {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}:{} ", self.filename, self.line)
    }
}