Skip to content

Commit

Permalink
Move private function near the one area it is used
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Jul 13, 2016
1 parent 88bfe9c commit b4379aa
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/cargo/util/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,24 @@ impl TomlManifest {
layout: &layout,
};

fn process_dependencies(
cx: &mut Context,
new_deps: Option<&HashMap<String, TomlDependency>>,
kind: Option<Kind>)
-> CargoResult<()>
{
let dependencies = match new_deps {
Some(ref dependencies) => dependencies,
None => return Ok(())
};
for (n, v) in dependencies.iter() {
let dep = try!(v.to_dependency(n, cx, kind));
cx.deps.push(dep);
}

Ok(())
}

// Collect the deps
try!(process_dependencies(&mut cx, self.dependencies.as_ref(),
None));
Expand Down Expand Up @@ -800,22 +818,6 @@ impl TomlDependency {
}
}

fn process_dependencies(cx: &mut Context,
new_deps: Option<&HashMap<String, TomlDependency>>,
kind: Option<Kind>)
-> CargoResult<()> {
let dependencies = match new_deps {
Some(ref dependencies) => dependencies,
None => return Ok(())
};
for (n, v) in dependencies.iter() {
let dep = try!(v.to_dependency(n, cx, kind));
cx.deps.push(dep);
}

Ok(())
}

#[derive(RustcDecodable, Debug, Clone)]
struct TomlTarget {
name: Option<String>,
Expand Down

0 comments on commit b4379aa

Please sign in to comment.