about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/rt/rust_log.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/rt/rust_log.cpp b/src/rt/rust_log.cpp
index cbad666ef2a..26c038e2507 100644
--- a/src/rt/rust_log.cpp
+++ b/src/rt/rust_log.cpp
@@ -245,13 +245,12 @@ void update_crate_map(const cratemap* map, log_directive* dirs,
     iter_crate_map(map, update_entry, &args);
 }
 
+void print_mod_name(const mod_entry* mod, void *cooke) {
+    printf(" %s\n", mod->name);
+}
+
 void print_crate_log_map(const cratemap* map) {
-    for (const mod_entry* cur = map->entries(); cur->name; cur++) {
-        printf("  %s\n", cur->name);
-    }
-    for (cratemap::iterator i = map->begin(), e = map->end(); i != e; ++i) {
-        print_crate_log_map(*i);
-    }
+    iter_crate_map(map, print_mod_name, NULL);
 }
 
 // These are pseudo-modules used to control logging in the runtime.