pub fn find_rule<'a>(makefile: &Makefile, target: &Target) -> Rule {
    makefile
        .rules
        .iter()
        .find(|r| r.target == *target)
        .unwrap_or_else(|| panic!("No such rule {:?}", target))
        .clone()
}
/// Finds a rule matching the target in a `Makefile`.
///
/// ```
/// # use fab::makefile::{Rule, Makefile, Target};
/// # use fab::plan::{find_rule};
///
/// let compile_c_code_rule = Rule {
///     target: Target::named("main.c"),
///     dependencies: vec![Target::named("main.o")],
///     commands: vec![]
/// };
///
/// let makefile = Makefile { rules: vec![compile_c_code_rule.clone()] };
/// assert_eq!(compile_c_code_rule, find_rule(&makefile, &Target::named("main.c")));
/// ```
Finds a rule matching the target in a `Makefile`.
Finds a rule matching the target in a ` Makefile ` .
pub fn find_rule<'a>(makefile: &Makefile, target: &Target) -> Rule {
    makefile
        .rules
        .iter()
        .find(|r| r.target == *target)
        .unwrap_or_else(|| panic!("No such rule {:?}", target))
        .clone()
}
pub fn find_rule < ' a > ( makefile : & Makefile , target : & Target ) -> Rule { makefile . rules . iter ( ) . find ( | r | r . target == * target ) . unwrap_or_else ( | | panic ! ( " " target ) ) . clone ( ) }
Finds a rule matching the target in a `Makefile`.
Finds a rule matching the target in a ` Makefile ` .
makefile
&Makefile
target
&Target
makefile
&Makefile
target
&Target
use fab::makefile::{rule, makefile, target};
None
use fab::plan::{find_rule};
let compile_c_code_rule = Rule {
target: Target::named("main.c"),
dependencies: vec![Target::named("main.o")],
commands: vec![]
}.

let makefile = Makefile { rules: vec![compile_c_code_rule.clone()] };
assert_eq!(compile_c_code_rule, find_rule(&makefile, &Target::named("main.c")));
```
let compile_c_code_rule = Rule { target : Target :: named ( " main . c " ) dependencies : vec! [ Target :: named ( " main . o " ) ] commands : vec! [] } . let makefile = Makefile { rules : vec! [ compile_c_code_rule . clone () ] } ; assert_eq! ( compile_c_code_rule find_rule ( &makefile &Target :: named ( " main . c " ))) ; ` ` `