aboutsummaryrefslogtreecommitdiff
path: root/src/basic_actors.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-07 10:17:40 -0700
committerMelody Horn <melody@boringcactus.com>2021-03-07 10:17:40 -0700
commitd5083f4cce47567644fd1b2c5923e5d0dcd98d44 (patch)
treeca625bf36a221bef5fd66cec7fb793a36ebad56b /src/basic_actors.rs
parentc8cfeabc011bfabb6303023a969155ded926d95c (diff)
downloadhope-d5083f4cce47567644fd1b2c5923e5d0dcd98d44.tar.gz
hope-d5083f4cce47567644fd1b2c5923e5d0dcd98d44.zip
don't round-trip everything through strings!!!
Diffstat (limited to 'src/basic_actors.rs')
-rw-r--r--src/basic_actors.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic_actors.rs b/src/basic_actors.rs
index da391cf..130c1e2 100644
--- a/src/basic_actors.rs
+++ b/src/basic_actors.rs
@@ -1,4 +1,5 @@
use std::collections::HashMap;
+use std::convert::TryInto;
use std::sync::mpsc::{SyncSender, Receiver};
use crate::actor::{Value, Type, Actorful, Slot};
@@ -98,7 +99,7 @@ impl Actorful for RepeatValue {
if let Value::Number(count) = count {
// TODO figure out what a smart thing to do would be here instead
// this API design is deliberately suboptimal because i'd like to not do it
- let count: usize = format!("{}", count).parse().unwrap();
+ let count: usize = count.try_into().unwrap();
let vec = vec![value; count];
output_channels["List"].send(Value::List(vec)).unwrap();
}