Skip to content

Use range in debugging span #1123

@janTatesa

Description

@janTatesa

Currently Span implements debug in such a way that start and end are separate fields. But I think this would be a better implementation

impl<'i> fmt::Debug for Span<'i> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.debug_struct("Span")
            .field("str", &self.as_str())
            .field("range", &self.start..self.end)
            .finish()
    }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions