Skip to content

docs: improve ancestors_between docs to make behaviour more clear#2796

Open
xanderbailey wants to merge 1 commit into
apache:mainfrom
xanderbailey:xb/improve_docs_for_ancestores
Open

docs: improve ancestors_between docs to make behaviour more clear#2796
xanderbailey wants to merge 1 commit into
apache:mainfrom
xanderbailey:xb/improve_docs_for_ancestores

Conversation

@xanderbailey

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • Closes #.

Test here

fn test_ancestors_between_nonexistent_oldest_returns_full_chain() {
let meta = metadata();
// oldest_snapshot_id doesn't exist in the chain, so take_while never stops
let ids: Vec<i64> = ancestors_between(&meta, S5, Some(999))
.map(|s| s.snapshot_id())
.collect();
assert_eq!(ids, vec![S5, S4, S3, S2, S1]);
}
shows that if oldest_snapshot_id is not an ancestor of latest_snapshot_id then the whole chain is returned but this isn't clear to the caller without reading the implementation or the tests.

What changes are included in this PR?

Docs changes

Are these changes tested?

@xanderbailey

Copy link
Copy Markdown
Contributor Author

@CTTY are you able to take a look here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant