Skip to content

Ergonomy improvements for get_root_directory_from_revision_or_release

Stefano Zacchiroli requested to merge zack/swh-graph:feature/stdlib into master

Various changes, which I'm also proposing as coding guidelines for (at least) the upcoming "stdlib" on top of swh-graph-rs:

  • rename the function to find_root_dir, for various reasons:

    • much shorter

    • use SWHID-compatible 3-letter names for object types, rather than variable-size longer ones

    • being agnostic on the preconditions on input type, so that no renaming is needed in the future (e.g., I think we can make this the identify function on directory nodes)

  • simplify the return type to avoid the double .unwrap() need, as Result is useless in most cases for client code anyway

  • add missing tests for this functionality

Merge request reports