From 1659c90a27cf81ec9c7255140f4909ae627f67c4 Mon Sep 17 00:00:00 2001 From: "anthony.cicchetti" Date: Wed, 17 May 2017 15:42:02 -0400 Subject: [PATCH] Rust - WIP run-length-encoding --- rust/test/src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rust/test/src/main.rs b/rust/test/src/main.rs index ea2fbdc..c2dbdf8 100644 --- a/rust/test/src/main.rs +++ b/rust/test/src/main.rs @@ -10,12 +10,14 @@ pub fn encode(inp_string: &'static str) -> String{ } // Tokenizes a to-be-encoded string -fn tokenize(inp_string: &'static str) -> Vec<&str>{ - return vec!["AAA","BB","C", "DDDD"] +fn tokenize(inp_string: &'static str) -> Vec{ + + + vec![String::from("AAA"), String::from("BB"), String::from("C"), String::from("DDDD")] } // "Tuple-izes" a to-be-encoded vector -fn tupleize(inp_vec: Vec<&str>) -> Vec<(char, usize)>{ +fn tupleize(inp_vec: Vec) -> Vec<(char, usize)>{ let mut tupleized: Vec<(char, usize)> = Vec::new(); for each in inp_vec { tupleized.push((each.chars().next().unwrap(), each.len()));