# prefer-set-over-unit-map

Prefer sets over maps whose values are unit

A map with unit values expresses only whether each key is present.
Instead, you SHOULD use `Set<K>` to represent membership directly.

- Category: style
- Level: warning
- Fix: suggestion
- Scope: module

## Reported

```ds title="main.ds"
const values = new Map<string, void>();
```

## Accepted

```ds title="main.ds"
const values = new Set<string>();
```

## Prior art

- [Clippy · zero_sized_map_values](https://rust-lang.github.io/rust-clippy/master/index.html#zero_sized_map_values)

[language/linter/src/rules/style/prefer_set_over_unit_map.rs:8](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/style/prefer_set_over_unit_map.rs#L8)
