let source_id = SourceId::for_git(&url, reference.as_slice());
- let source = GitSource::new(&source_id, &try!(Config::new().to_cli(1)));
+ let mut source = GitSource::new(&source_id, &try!(Config::new().to_cli(1)));
try!(source.update().map_err(|e| {
CLIError::new(format!("Couldn't update {}: {}", source, e), None::<&str>, 1)
}
fn load(&mut self, namespace: &SourceId, override: bool) -> CargoResult<()> {
- let source = namespace.load(&try!(Config::new()));
+ let mut source = namespace.load(&try!(Config::new()));
let dst = if override { &mut self.overrides } else { &mut self.summaries };
// Ensure the source has fetched all necessary remote data.
* get the entire list of all names, versions and dependencies of
* packages managed by the Source.
*/
- fn update(&self) -> CargoResult<()>;
+ fn update(&mut self) -> CargoResult<()>;
/**
* The list method lists all names, versions and dependencies of
}
impl Source for SourceSet {
- fn update(&self) -> CargoResult<()> {
- for source in self.sources.iter() {
+ fn update(&mut self) -> CargoResult<()> {
+ for source in self.sources.mut_iter() {
try!(source.update());
}
}
impl Source for GitSource {
- fn update(&self) -> CargoResult<()> {
+ fn update(&mut self) -> CargoResult<()> {
println!("Updating git repository `{}`", self.remote.get_url());
log!(5, "updating git source `{}`", self.remote);
let repo = try!(self.remote.checkout(&self.db_path));
}
impl Source for PathSource {
- fn update(&self) -> CargoResult<()> {
+ fn update(&mut self) -> CargoResult<()> {
Ok(())
}