Summary: As in title. I will try to fix up more such Clippy issues as-and-when I get some spare cycles.
Reviewed By: yancouto
Differential Revision: D43304007
fbshipit-source-id: 602cefd08df7608c4390e51211e88a873c645b00
Summary: This is the latest version number [on crates](https://crates.io/crates/fbinit_macros/0.1.2).
Reviewed By: jsgf
Differential Revision: D40536148
fbshipit-source-id: 86fc58f09cdb716e2aed8571a8ddee65f5dfc844
Summary: This release makes async trait methods work better with rust-analyzer's "go to definition" and other IDE functionality.
Reviewed By: zertosh
Differential Revision: D40532047
fbshipit-source-id: 1871d1819ebe1aab0846b0135f051c45e6e8821b
Summary:
Some of these lints must have come from the update to rust 1.64.0. Some might have slipped through recent diffs.
These three categories were encountered:
* [unnecessary_lazy_evaluations](https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations) (this is an older lint, but the `then_some` case must be recent)
```
warning: unnecessary closure used with `bool::then`
--> eden/mononoke/tools/facebook/derived_data_metrics_tailer/src/main.rs:314:28
|
314 | anyhow::Ok(is_ancestor.then(|| c))
| ^^^^^^^^^^^^----------
| |
| help: use `then_some(..)` instead: `then_some(c)`
|
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
```
* [manual_retain](https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain) (new in 1.64.0)
```
warning: this expression can be written more simply using `.retain()`
--> eden/mononoke/reachabilityindex/skiplist/src/lib.rs:365:9
|
365 | / bfs_layer = bfs_layer
366 | | .into_iter()
367 | | .filter(|(hash, _gen)| !skip_list_edges.mapping.contains_key(hash))
368 | | .collect();
| |______________________^ help: consider calling `.retain()` instead: `bfs_layer.retain(|hash, &mut _gen| !skip_list_edges.mapping.contains_key(hash))`
|
= note: `#[warn(clippy::manual_retain)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain
```
* [needless_borrow](https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow) (this is not new, so probably due to regressions on master)
```
warning: this expression borrows a value the compiler would automatically borrow
--> eden/mononoke/mercurial/types/src/blobnode.rs:239:45
|
239 | let pid1: Option<HgNodeHash> = Some((&p1).nodeid());
| ^^^^^ help: change this to: `p1`
|
= note: `#[warn(clippy::needless_borrow)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
```
Reviewed By: mitrandir77
Differential Revision: D39885511
fbshipit-source-id: 835045999d621f01392baefdc5e790a2292fc498
Summary:
Implement path ACL checks for basic read accesses to the repo. Attempts to access
a tree or file will fail if the user doesn't have access to that path. Attempts
to access arbitrary trees or files by their IDs will also fail if the user does not
have full repo read access, as the paths for these accesses cannot be checked.
In this initial version, we do not prevent queries that would allow users to
find out the names of paths that they do not have access to: for example
listing all files in a directory would still work.
Reviewed By: RajivTS
Differential Revision: D38129042
fbshipit-source-id: 1b2b6e5881712628c6d979d329447afac2050626
Summary:
The hg_sync job relies on `BlobRepo`, however enough pieces have been
refactored for that to change. This diff replaces `BlobRepo` with a custom
`Repo` struct for the hg_sync job that only has the required facets in it.
Reviewed By: yancouto
Differential Revision: D37789411
fbshipit-source-id: abe3ec5e8357a8e775a016542e80bba504493999
Summary:
When given a (commit, path) pair, `AclRegions` facet returns all Hipster ACLs that permit accessing that (commit, path). See D34272143 for how configuration works.
To answer those queries effectively, we precompute a trie over all path prefixes from rules in the config. Then, for each (commit, path) query:
1. Use the trie to extract all rules that match by path.
2. For all rules we got from #1 naively check that the given commit matches them.
Design doc: https://docs.google.com/document/d/1MQBk-N-kRS7L-7IoFzkN0BdCif1UfyDQd0P1qOnx8TQ/edit?usp=sharing
Reviewed By: markbt
Differential Revision: D34674134
fbshipit-source-id: b7ca5c6a1651cd6ef379e5a4d12068f15492c496