diff options
| author | Polesznyák Márk László <116908301+pml68@users.noreply.github.com> | 2025-03-23 02:49:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-23 02:49:57 +0100 |
| commit | 3076889c00116b22f022792471253e7188c6e93e (patch) | |
| tree | bff0cda7a9152e9f94d3176bbf5acaf879394f5f /src/values/pixels.rs | |
| parent | feat: update to Rust 2024 (diff) | |
| parent | feat: finish `ApplyOptions` impls (diff) | |
| download | iced-builder-3076889c00116b22f022792471253e7188c6e93e.tar.gz | |
Merge pull request #7 from pml68/feat/options-backend
Options backend done (for now)
Diffstat (limited to '')
| -rw-r--r-- | src/values/pixels.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/values/pixels.rs b/src/values/pixels.rs new file mode 100644 index 0000000..b2b0047 --- /dev/null +++ b/src/values/pixels.rs @@ -0,0 +1,18 @@ +use std::num::ParseFloatError; +use std::str::FromStr; + +use iced::Pixels; + +use super::Value; + +impl Value for Pixels { + type Err = ParseFloatError; + + fn from_str(s: &str) -> Result<Self, Self::Err> { + Ok(Pixels(f32::from_str(s.trim())?)) + } + + fn to_string(&self) -> String { + self.0.to_string() + } +} |
