summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-24 20:56:43 -0500
committerpommicket <pommicket@gmail.com>2023-01-24 20:56:43 -0500
commit71dc7b8671449f936a2875e6f8a9649131234fc4 (patch)
tree76a45a615070948c79ad7205e786517858c321d2
parentcbdb80698fd7128e7bcc63c8513e53731dda0963 (diff)
remove whitespace from *inside* scene string
-rw-r--r--src/main.rs1
-rw-r--r--src/sdf.rs2
2 files changed, 1 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 8f8859b..b8f8329 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,7 +1,6 @@
/*
@TODO:
- reload settings.txt when changed
-- strip ' ' and '\n' from *inside* string
- flash error on bad string (see @TODO(error handling))
- RnToRn functions (& add back in RToR)
- also add PerComponent(Box<RToR>,Box<RToR>,Box<RToR>) in R3ToR3
diff --git a/src/sdf.rs b/src/sdf.rs
index e84c2f0..929c324 100644
--- a/src/sdf.rs
+++ b/src/sdf.rs
@@ -67,7 +67,7 @@ fn encode_hex(data: &[u8]) -> String {
/// decode `data` from hexadecimal.
/// returns None if this isn't a valid hexadecimal string.
fn decode_hex(data: &str) -> Option<Vec<u8>> {
- let data = data.trim();
+ let data = data.replace(char::is_whitespace, "");
if data.len() % 2 != 0 {
return None;
}