pub fn make_resolver<'g>(
        &'g self,
        pkg_graph: &'g PackageGraph,
    ) -> Result<impl Fn(&PackageQuery<'g>, PackageLink<'g>) -> bool + 'g> {
        let omitted_package_ids: HashSet<_> =
            self.base_opts.omitted_package_ids(pkg_graph).collect();

        let platform_spec = string_to_platform_spec(self.target.as_deref())
            .wrap_err_with(|| "target platform isn't known")?;

        let ret = move |_: &PackageQuery<'g>, link| {
            // filter by the kind of dependency (--kind)
            let include_kind = self.base_opts.kind.should_traverse(&link);

            let include_type = self.eval(link, |req| {
                req.status().enabled_on(&platform_spec.clone()) != EnabledTernary::Disabled
            });

            // filter out provided edge targets (--omit-edges-into)
            let include_edge = !omitted_package_ids.contains(link.to().id());

            include_kind && include_type && include_edge
        };
        Ok(ret)
    }
Construct a package resolver based on the filter options.
cargo-guppy/src/core.rs