From 5c9b7b026a945c002f5c59202f71543129c75536 Mon Sep 17 00:00:00 2001 From: peshwar9 Date: Fri, 9 Oct 2020 21:23:51 +0530 Subject: [PATCH] FD updates for chapter 3 --- chapter3/src/lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/chapter3/src/lib.rs b/chapter3/src/lib.rs index e9d9377..5631ed2 100644 --- a/chapter3/src/lib.rs +++ b/chapter3/src/lib.rs @@ -27,14 +27,12 @@ pub enum TagType { //this checks if a symbol string is contained within another string pub fn check_symbol_string(input: &str, symbol: &str) -> bool { - let symbols = input.chars(); - symbols.as_str().contains(symbol) + input.contains(symbol) } // This checks for matching symbol strings in a given input pub fn check_matching_pair(input: &str, symbol1: &str, symbol2: &str) -> bool { - let input_iter = input.chars(); - input_iter.as_str().contains(symbol1) && input_iter.as_str().contains(symbol2) + input.contains(symbol1) && input.contains(symbol2) } // this returns index of given char symbol, if symbol is present. @@ -105,7 +103,7 @@ pub fn generate_html_template_var( context: HashMap, ) -> String { let mut html = String::new(); - + println!("expression data is:{:?}", content); if let Some(h) = content.head { html.push_str(&h); }