From 8adb8b5105b5d6304beafe1cbbd782db332f4039 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Fri, 20 Dec 2019 22:39:01 +0900 Subject: [PATCH] Fix clippy warnings --- src/compile.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/compile.rs b/src/compile.rs index 39f550d..24df923 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -1083,9 +1083,7 @@ impl Compiler { // Doc string value: self.emit(Instruction::LoadConst { value: match doc_str { - Some(doc) => bytecode::Constant::String { - value: doc.to_string(), - }, + Some(doc) => bytecode::Constant::String { value: doc }, None => bytecode::Constant::None, // set docstring None if not declared }, }); @@ -2199,7 +2197,7 @@ fn get_doc(body: &[ast::Statement]) -> (&[ast::Statement], Option) { if let ast::StatementType::Expression { ref expression } = val.node { if let ast::ExpressionType::String { value } = &expression.node { if let Some(value) = try_get_constant_string(value) { - return (body_rest, Some(value.to_string())); + return (body_rest, Some(value)); } } }