chiark
/
gitweb
/
~ianmdlvl
/
nailing-cargo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c00090f
)
nailing-cargo: Refactor target_dependency_tables
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 25 Jul 2020 16:26:58 +0000
(17:26 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 25 Jul 2020 16:27:06 +0000
(17:27 +0100)
NFC. This function needs enhancing.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
nailing-cargo
patch
|
blob
|
history
diff --git
a/nailing-cargo
b/nailing-cargo
index 512e55916ee2da7af03b872560565ebc4dad2a99..d196db5fbb30c5f9dd150f29f25631a141f6d624 100755
(executable)
--- a/
nailing-cargo
+++ b/
nailing-cargo
@@
-243,10
+243,14
@@
sub get_dependency_tables ($) {
my ($toml) = @_;
my @keys = qw(dependencies build-dependencies dev-dependencies);
my @r;
- foreach my $k (@keys) {
- my $deps = $toml->{$k};
- push @r, $deps if $deps;
- }
+ my $process = sub {
+ my ($node) = @_;
+ foreach my $k (@keys) {
+ my $deps = $node->{$k};
+ push @r, $deps if $deps;
+ }
+ };
+ $process->($toml);
@r;
}