1
Fork 0

document that Span::to can go backwards

This commit is contained in:
Lukas Markeffsky 2022-12-25 17:41:31 +01:00
parent 94d6245003
commit 83e653920d

View file

@ -796,6 +796,9 @@ impl Span {
/// Returns a `Span` that would enclose both `self` and `end`. /// Returns a `Span` that would enclose both `self` and `end`.
/// ///
/// Note that this can also be used to extend the span "backwards":
/// `start.to(end)` and `end.to(start)` return the same `Span`.
///
/// ```text /// ```text
/// ____ ___ /// ____ ___
/// self lorem ipsum end /// self lorem ipsum end