Merge pull request #1971 from AleoHQ/doc-span-add

[span] Add doc comment to explain span addition.
This commit is contained in:
Collin Chin 2022-08-01 15:39:39 -07:00 committed by GitHub
commit 0cd6a10d6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,6 +71,8 @@ impl std::ops::Add for &Span {
impl std::ops::Add for Span {
type Output = Self;
/// Add two spans together.
/// The resulting span is the smallest span that includes both.
fn add(self, other: Self) -> Self {
let lo = self.lo.min(other.lo);
let hi = self.hi.max(other.hi);