dtolnay / dtolnay/remain

Can `remain` support checking if the constant names in a module are sorted?

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
126
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Hi,

First of all, thank you for this nice package. I have just discovered it and have started using it in my project.

I have another use case related to constants declared in a module, not sure if `remain` can support it.
For example, the following module is used to organize keywords, which are string constants:

```rust
/// Keyword to parse command line arguments
pub mod kw {
pub const CLANG_OPTIONS: &str = "clang-options";
pub const DEBUG_MODE: &str = "debug-mode";
pub const DISABLE_NORMALIZE: &str = "disable-normalize";
pub const DISABLE_OPTIMIZE: &str = "disable-optimize";
pub const DISABLE_PRINTING: &str = "disable-printing";
pub const INSTRUMENT_BUG_ANNOTS: &str = "instrument-bug-annots";
pub const PRINT_COMPILED_PROG: &str = "print-compiled-prog";
pub const PRINT_OPTIMIZED_PROG: &str = "print-optimized-prog";
pub const PRINT_NORMALIZED_PROG: &str = "print-normalized-prog";
pub const RUSTC_OPTIONS: &str = "rustc-options";
pub const SOLANG_OPTIONS: &str = "solang-options";
pub const SOLC_OPTIONS: &str = "solc-options";
pub const COMPILER: &str = "compiler";
}
```

The list may get longer. So, I wonder if `remain` can support checking if all constant names are sorted?

It will be very useful to avoid the duplication of constants.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.