Skip to content

Consider disallowing std hashmap/hashset via clippy #19869

@Jefffrey

Description

@Jefffrey

We have a clippy config for disallowing types:

disallowed-types = [
{ path = "std::time::Instant", reason = "Use `datafusion_common::instant::Instant` instead for WASM compatibility" },
]

In datafusion-common we re-export hashbrown hashmaps/hashsets to encourage usage of them over std versions:

// The HashMap and HashSet implementations that should be used as the uniform defaults
pub type HashMap<K, V, S = DefaultHashBuilder> = hashbrown::HashMap<K, V, S>;
pub type HashSet<T, S = DefaultHashBuilder> = hashbrown::HashSet<T, S>;
pub mod hash_map {
pub use hashbrown::hash_map::Entry;
}
pub mod hash_set {
pub use hashbrown::hash_set::Entry;
}

Consider using clippy to enforce this?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions