diff options
Diffstat (limited to 'src/window_size.rs')
| -rw-r--r-- | src/window_size.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/window_size.rs b/src/window_size.rs index bfc3957..620a307 100644 --- a/src/window_size.rs +++ b/src/window_size.rs @@ -1,8 +1,8 @@ /// The max value of the custom window size is `u32::MAX`. +/// The min value of the custom window size is `WindowSize::Size256`. /// This is because it's the maximum latency one can report to a CLAP host. #[derive(Debug, PartialEq)] pub enum WindowSize { - Size128, Size256, Size512, Size1024, @@ -16,10 +16,9 @@ pub enum WindowSize { impl From<usize> for WindowSize { fn from(item: usize) -> Self { - let item = item.clamp(0, u32::MAX as usize); + let item = item.clamp(256, u32::MAX as usize); match item { - 128 => Self::Size128, 256 => Self::Size256, 512 => Self::Size512, 1024 => Self::Size1024, @@ -36,7 +35,6 @@ impl From<usize> for WindowSize { impl WindowSize { pub fn as_str(&self) -> &'static str { match self { - Self::Size128 => "128", Self::Size256 => "256", Self::Size512 => "512", Self::Size1024 => "1024", @@ -51,7 +49,6 @@ impl WindowSize { pub fn inner(&self) -> usize { match self { - Self::Size128 => 128, Self::Size256 => 256, Self::Size512 => 512, Self::Size1024 => 1024, @@ -66,7 +63,6 @@ impl WindowSize { pub fn iter() -> impl Iterator<Item = Self> { [ - Self::Size128, Self::Size256, Self::Size512, Self::Size1024, |
