From 1a1faff2f67613ed0b89e1a34e6c3fd02ca6fd83 Mon Sep 17 00:00:00 2001 From: Geert-Jan Zwiers Date: Fri, 27 Jan 2023 16:16:38 +0100 Subject: chore(cli/cache): fewer string allocations (#17549) --- cli/cache/parsed_source.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/cache/parsed_source.rs') diff --git a/cli/cache/parsed_source.rs b/cli/cache/parsed_source.rs index cef33e354..6385e7384 100644 --- a/cli/cache/parsed_source.rs +++ b/cli/cache/parsed_source.rs @@ -219,7 +219,7 @@ impl ParsedSourceCacheModuleAnalyzer { stmt.execute(params![ specifier.as_str(), &media_type.to_string(), - &source_hash.to_string(), + &source_hash, &serde_json::to_string(&module_info)?, ])?; Ok(()) @@ -298,7 +298,7 @@ fn create_tables( |row| row.get(0), ) .ok(); - if data_cli_version != Some(cli_version.to_string()) { + if data_cli_version.as_deref() != Some(&cli_version) { conn.execute("DELETE FROM moduleinfocache", params![])?; let mut stmt = conn .prepare("INSERT OR REPLACE INTO info (key, value) VALUES (?1, ?2)")?; -- cgit v1.2.3