Skip to content

feat: Use enum for duty ratio#218

Merged
Lokathor merged 1 commit into
rust-console:mainfrom
yutannihilation:feat/use-enum-for-duty
Jun 29, 2026
Merged

feat: Use enum for duty ratio#218
Lokathor merged 1 commit into
rust-console:mainfrom
yutannihilation:feat/use-enum-for-duty

Conversation

@yutannihilation

Copy link
Copy Markdown
Contributor

TonePattern::with_duty() takes a 2-bit value that represents the duty ratio. But, I think it's hard to specify the ratio by a raw value. This pull request adds an enum to represent the four types of duty ratios (12.5%, 25%, 50%, 75%) and use it as the argument of with_duty().

pub enum DutyRatio {
  _12_5 = 0,
  _25 = 1,
  _50 = 2,
  _75 = 3,
}

References:

@Lokathor
Lokathor merged commit 60cd44f into rust-console:main Jun 29, 2026
1 check failed
@yutannihilation
yutannihilation deleted the feat/use-enum-for-duty branch June 29, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants