Impl Default for SourceLocation (#4328)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
Jeong, YunWon 2023-05-16 16:03:43 +09:00 committed by GitHub
parent fa26860296
commit badade3ccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 15 deletions

View file

@ -225,6 +225,15 @@ pub struct SourceLocation {
pub column: OneIndexed,
}
impl Default for SourceLocation {
fn default() -> Self {
Self {
row: OneIndexed::MIN,
column: OneIndexed::MIN,
}
}
}
impl Debug for SourceLocation {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("SourceLocation")