pub fn visit_dependencies(
        &mut self,
        mut handle_dependencies: impl FnMut(&str, &'static str, &mut toml_edit::Table),
    ) {
        fn recurse_dependencies(
            path: String,
            table: &mut toml_edit::Table,
            handle_dependencies: &mut impl FnMut(&str, &'static str, &mut toml_edit::Table),
        ) {
            // Walk through tables recursively so that we can find *all* dependencies.
            for (key, item) in table.iter_mut() {
                if let Item::Table(table) = item {
                    let path = if path.is_empty() {
                        key.to_string()
                    } else {
                        format!("{path}.{key}")
                    };
                    recurse_dependencies(path, table, handle_dependencies);
                }
            }
            for dependency_kind in DEPENDENCY_KINDS {
                let Some(Item::Table(table)) = table.get_mut(dependency_kind) else {
                    continue;
                };

                handle_dependencies(&path, dependency_kind, table);
            }
        }

        recurse_dependencies(
            String::new(),
            self.manifest.as_table_mut(),
            &mut handle_dependencies,
        );
    }
Calls a callback for each table that contains dependencies.

Callback arguments:
- `path`: The path to the table (e.g. `dependencies.package`)
- `dependency_kind`: The kind of dependency (e.g. `dependencies`,
`dev-dependencies`)
- `table`: The table itself
xtask/src/cargo.rs