Skip to content

Commit 2f5b303

Browse files
committed
Update doc for CompileFilter
1 parent ecbaec1 commit 2f5b303

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/cargo/ops/cargo_compile.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ impl FilterRule {
759759
}
760760

761761
impl CompileFilter {
762-
/// Construct a CompileFilter from raw command line arguments.
762+
/// Constructs a filter from raw command line arguments.
763763
pub fn from_raw_arguments(
764764
lib_only: bool,
765765
bins: Vec<String>,
@@ -788,7 +788,7 @@ impl CompileFilter {
788788
CompileFilter::new(rule_lib, rule_bins, rule_tsts, rule_exms, rule_bens)
789789
}
790790

791-
/// Construct a CompileFilter from underlying primitives.
791+
/// Constructs a filter from underlying primitives.
792792
pub fn new(
793793
rule_lib: LibRule,
794794
rule_bins: FilterRule,
@@ -817,6 +817,7 @@ impl CompileFilter {
817817
}
818818
}
819819

820+
/// Constructs a filter that includes all targets.
820821
pub fn new_all_targets() -> CompileFilter {
821822
CompileFilter::Only {
822823
all_targets: true,
@@ -872,6 +873,7 @@ impl CompileFilter {
872873
}
873874
}
874875

876+
/// Indicates if Cargo needs to build any dev dependency.
875877
pub fn need_dev_deps(&self, mode: CompileMode) -> bool {
876878
match mode {
877879
CompileMode::Test | CompileMode::Doctest | CompileMode::Bench => true,
@@ -892,8 +894,8 @@ impl CompileFilter {
892894
}
893895
}
894896

895-
// this selects targets for "cargo run". for logic to select targets for
896-
// other subcommands, see generate_targets and filter_default_targets
897+
/// Selects targets for "cargo run". for logic to select targets for other
898+
/// subcommands, see `generate_targets` and `filter_default_targets`.
897899
pub fn target_run(&self, target: &Target) -> bool {
898900
match *self {
899901
CompileFilter::Default { .. } => true,

0 commit comments

Comments
 (0)