Anders429 / Anders429/word_filter
Use new() method instead of having structs public
- Linguagem predominante
- Rust
- Estrelas
- 3
- Forks
- 0
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Rather than having all of the different internal structs have `public` visibility, it may be possible to use a `new()` method on `WordFilter` to construct it instead. The `new()` method would need to be a `const fn` to be used in `static` context.
The input parameter would just be a fixed-size array of size `N`, with each element being a tuple containing the values needed for a `State`, which are:
- `Flags` - This will be an integer value after #67 is completed.
- `c_transitions` - This will be a closure.
- `aliases` - slice of 2-tuples of references.
- `graphemes` - slice of references.
The references may be a problem, since they reference into the array being constructed in the `new()` method. This may not have to be a problem though, depending on how self-referencing works in const contexts.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.