fn note_working_on(
        &mut self,
        config: &Config,
        unit: &Unit,
        fresh: Freshness,
    ) -> CargoResult<()> {
        if (self.compiled.contains(&unit.pkg.package_id()) && !unit.mode.is_doc())
            || (self.documented.contains(&unit.pkg.package_id()) && unit.mode.is_doc())
        {
            return Ok(());
        }

        match fresh {
            // Any dirty stage which runs at least one command gets printed as
            // being a compiled package.
            Dirty => {
                if unit.mode.is_doc() {
                    self.documented.insert(unit.pkg.package_id());
                    config.shell().status("Documenting", &unit.pkg)?;
                } else if unit.mode.is_doc_test() {
                    // Skip doc test.
                } else {
                    self.compiled.insert(unit.pkg.package_id());
                    if unit.mode.is_check() {
                        config.shell().status("Checking", &unit.pkg)?;
                    } else {
                        config.shell().status("Compiling", &unit.pkg)?;
                    }
                }
            }
            Fresh => {
                // If doc test are last, only print "Fresh" if nothing has been printed.
                if self.counts[&unit.pkg.package_id()] == 0
                    && !(unit.mode.is_doc_test() && self.compiled.contains(&unit.pkg.package_id()))
                {
                    self.compiled.insert(unit.pkg.package_id());
                    config.shell().verbose(|c| c.status("Fresh", &unit.pkg))?;
                }
            }
        }
        Ok(())
    }
// This isn't super trivial because we don't want to print loads and
// loads of information to the console, but we also want to produce a
// faithful representation of what's happening. This is somewhat nuanced
// as a package can start compiling *very* early on because of custom
// build commands and such.
//
// In general, we try to print "Compiling" for the first nontrivial task
// run for a package, regardless of when that is. We then don't print
// out any more information for a package after we've printed it once.
This isn't super trivial because we don't want to print loads and
loads of information to the console, but we also want to produce a
faithful representation of what's happening. This is somewhat nuanced
as a package can start compiling *very* early on because of custom
build commands and such.

In general, we try to print "Compiling" for the first nontrivial task
run for a package, regardless of when that is. We then don't print
out any more information for a package after we've printed it once.
This isn ' t super trivial because we don ' t want to print loads and loads of information to the console but we also want to produce a faithful representation of what ' s happening . This is somewhat nuanced as a package can start compiling * very * early on because of custom build commands and such . In general we try to print " Compiling " for the first nontrivial task run for a package regardless of when that is . We then don ' t print out any more information for a package after we ' ve printed it once .
fn note_working_on(
        &mut self,
        config: &Config,
        unit: &Unit,
        fresh: Freshness,
    ) -> CargoResult<()> {
        if (self.compiled.contains(&unit.pkg.package_id()) && !unit.mode.is_doc())
            || (self.documented.contains(&unit.pkg.package_id()) && unit.mode.is_doc())
        {
            return Ok(());
        }
        match fresh {
            // Any dirty stage which runs at least one command gets printed as
            // being a compiled package.
            Dirty => {
                if unit.mode.is_doc() {
                    self.documented.insert(unit.pkg.package_id());
                    config.shell().status("Documenting", &unit.pkg)?;
                } else if unit.mode.is_doc_test() {
                    // Skip doc test.
                } else {
                    self.compiled.insert(unit.pkg.package_id());
                    if unit.mode.is_check() {
                        config.shell().status("Checking", &unit.pkg)?;
                    } else {
                        config.shell().status("Compiling", &unit.pkg)?;
                    }
                }
            }
            Fresh => {
                // If doc test are last, only print "Fresh" if nothing has been printed.
                if self.counts[&unit.pkg.package_id()] == 0
                    && !(unit.mode.is_doc_test() && self.compiled.contains(&unit.pkg.package_id()))
                {
                    self.compiled.insert(unit.pkg.package_id());
                    config.shell().verbose(|c| c.status("Fresh", &unit.pkg))?;
                }
            }
        }
        Ok(())
    }
fn note_working_on ( & mut self , config : & Config , unit : & Unit , fresh : Freshness , ) -> CargoResult < ( ) > { if ( self . compiled . contains ( & unit . pkg . package_id ( ) ) && ! unit . mode . is_doc ( ) ) || ( self . documented . contains ( & unit . pkg . package_id ( ) ) && unit . mode . is_doc ( ) ) { return Ok ( ( ) ) ; } match fresh { // Any dirty stage which runs at least one command gets printed as // being a compiled package. Dirty => { if unit . mode . is_doc ( ) { self . documented . insert ( unit . pkg . package_id ( ) ) ; config . shell ( ) . status ( " " , & unit . pkg ) ? ; } else if unit . mode . is_doc_test ( ) { // Skip doc test. } else { self . compiled . insert ( unit . pkg . package_id ( ) ) ; if unit . mode . is_check ( ) { config . shell ( ) . status ( " " , & unit . pkg ) ? ; } else { config . shell ( ) . status ( " " , & unit . pkg ) ? ; } } } Fresh => { // If doc test are last, only print "Fresh" if nothing has been printed. if self . counts [ & unit . pkg . package_id ( ) ] == 0 && ! ( unit . mode . is_doc_test ( ) && self . compiled . contains ( & unit . pkg . package_id ( ) ) ) { self . compiled . insert ( unit . pkg . package_id ( ) ) ; config . shell ( ) . verbose ( | c | c . status ( " " , & unit . pkg ) ) ? ; } } } Ok ( ( ) ) }
This isn't super trivial because we don't want to print loads and
loads of information to the console, but we also want to produce a
faithful representation of what's happening.
This isn ' t super trivial because we don ' t want to print loads and loads of information to the console but we also want to produce a faithful representation of what ' s happening .
&mut self
config
&Config
unit
&Unit
fresh
Freshness
&mut self
config
&Config
unit
&Unit
fresh
Freshness