Use anyhow Result type for library methods

4 jobs for master in 2 minutes and 56 seconds (queued for 3 seconds)