@@ -9,12 +9,17 @@ now only need to be `pub(crate)`, `pub(super)`, or simply private.
9
9
10
10
` depub ` minimises the visibility of such items in files passed to it, using a
11
11
user-specified command (e.g. ` cargo check ` ) as an oracle to tell if its
12
- reduction of an item's visibility is valid or not. In essence, ` depub ` does a
13
- string search for ` pub ` , replaces it with ` pub crate ` and sees if a test
14
- command still succeeds. If it does, it keeps that visibility, otherwise it
15
- replaces with the original and tries the next item. Note that ` depub ` is
16
- inherently destructive: it overwrites files as it operates, so do not run it on
17
- source code that you do not want altered!
12
+ reduction of an item's visibility is valid or not. Note that ` depub ` is
13
+ entirely guided by the oracle command: if the code it compiles happens not to
14
+ use part of an intentionally public interface, then ` depub ` is likely to
15
+ suggest reducing its visibility even though that's what you want. The broader
16
+ the coverage of your oracle, the less this is an issue.
17
+
18
+ In essence, ` depub ` does a string search for ` pub ` , replaces it with `pub
19
+ crate` and sees if a test command still succeeds. If it does, it keeps that
20
+ visibility, otherwise it replaces with the original and tries the next item.
21
+ Note that ` depub ` is inherently destructive: it overwrites files as it
22
+ operates, so do not run it on source code that you do not want altered!
18
23
19
24
The list of visibilities that ` depub ` considers is, in order: ` pub ` ,
20
25
` pub(crate) ` , ` pub(super) ` , and private (i.e. no ` pub ` keyword at all). ` depub `
0 commit comments