Refact constants into separate type
Open
CodeGen
- Dominant language
- Rust
- Stars
- 7
- Forks
- 11
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 5
Description
I think this could be folded into `defaultValue` as a new `Constant` type (might be useful elsewhere).
```ts
/** Constant defines a Rust const declaration */
export interface Constant {
kind: 'constant';
/** the name of the const */
name: string;
/** the value of the const */
value: Literal;
/** indicates the visibility of the const */
visibility: Visibility;
}
```
Then we can update the definition accordingly.
```ts
defaultValue?: Constant | string;
```
_Originally posted by @jhendrixMSFT in https://github.com/Azure/typespec-rust/pull/887#discussion_r2884751124_
Contributor guide
Assessment
This issue has not been assessed yet.