fn upgrade(self, upgraded_deps: &ActualUpgrades, dry_run: bool) -> Result<()> {
        if dry_run {
            let bufwtr = BufferWriter::stdout(ColorChoice::Always);
            let mut buffer = bufwtr.buffer();
            buffer
                .set_color(ColorSpec::new().set_fg(Some(Color::Cyan)).set_bold(true))
                .chain_err(|| "Failed to set output colour")?;
            write!(&mut buffer, "Starting dry run. ")
                .chain_err(|| "Failed to write dry run message")?;
            buffer
                .set_color(&ColorSpec::new())
                .chain_err(|| "Failed to clear output colour")?;
            writeln!(&mut buffer, "Changes will not be saved.")
                .chain_err(|| "Failed to write dry run message")?;
            bufwtr
                .print(&buffer)
                .chain_err(|| "Failed to print dry run message")?;
        }

        for (mut manifest, package) in self.0 {
            println!("{}:", package.name);

            for (name, version) in &upgraded_deps.0 {
                manifest.upgrade(&Dependency::new(name).set_version(version), dry_run)?;
            }
        }

        Ok(())
    }
/// Upgrade the manifests on disk following the previously-determined upgrade schema.
Upgrade the manifests on disk following the previously-determined upgrade schema.
Upgrade the manifests on disk following the previously - determined upgrade schema .
fn upgrade(self, upgraded_deps: &ActualUpgrades, dry_run: bool) -> Result<()> {
        if dry_run {
            let bufwtr = BufferWriter::stdout(ColorChoice::Always);
            let mut buffer = bufwtr.buffer();
            buffer
                .set_color(ColorSpec::new().set_fg(Some(Color::Cyan)).set_bold(true))
                .chain_err(|| "Failed to set output colour")?;
            write!(&mut buffer, "Starting dry run. ")
                .chain_err(|| "Failed to write dry run message")?;
            buffer
                .set_color(&ColorSpec::new())
                .chain_err(|| "Failed to clear output colour")?;
            writeln!(&mut buffer, "Changes will not be saved.")
                .chain_err(|| "Failed to write dry run message")?;
            bufwtr
                .print(&buffer)
                .chain_err(|| "Failed to print dry run message")?;
        }
        for (mut manifest, package) in self.0 {
            println!("{}:", package.name);
            for (name, version) in &upgraded_deps.0 {
                manifest.upgrade(&Dependency::new(name).set_version(version), dry_run)?;
            }
        }
        Ok(())
    }
fn upgrade ( self , upgraded_deps : & ActualUpgrades , dry_run : bool ) -> Result < ( ) > { if dry_run { let bufwtr = BufferWriter :: stdout ( ColorChoice :: Always ) ; let mut buffer = bufwtr . buffer ( ) ; buffer . set_color ( ColorSpec :: new ( ) . set_fg ( Some ( Color :: Cyan ) ) . set_bold ( true ) ) . chain_err ( | | " " ) ? ; write ! ( mut buffer " " ) . chain_err ( | | " " ) ? ; buffer . set_color ( & ColorSpec :: new ( ) ) . chain_err ( | | " " ) ? ; writeln ! ( mut buffer " " ) . chain_err ( | | " " ) ? ; bufwtr . print ( & buffer ) . chain_err ( | | " " ) ? ; } for ( mut manifest , package ) in self . 0 { println ! ( " " package name ) ; for ( name , version ) in & upgraded_deps . 0 { manifest . upgrade ( & Dependency :: new ( name ) . set_version ( version ) , dry_run ) ? ; } } Ok ( ( ) ) }
Upgrade the manifests on disk following the previously-determined upgrade schema.
Upgrade the manifests on disk following the previously - determined upgrade schema .
self
upgraded_deps
&ActualUpgrades
dry_run
bool