MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / try_extend

Method try_extend

atomic-core/src/change/credit.rs:584–591  ·  view source on GitHub ↗

Try to extend this range with another credit. Returns true if the extension was successful (credits match and lines are adjacent).

(&mut self, line: u64, credit: &Credit)

Source from the content-addressed store, hash-verified

582 ///
583 /// Returns true if the extension was successful (credits match and lines are adjacent).
584 pub fn try_extend(&mut self, line: u64, credit: &Credit) -> bool {
585 if line == self.end_line + 1 && self.credit == *credit {
586 self.end_line = line;
587 true
588 } else {
589 false
590 }
591 }
592}
593
594impl fmt::Display for CreditRange {

Callers 1

add_lineMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected