summaryrefslogtreecommitdiff
path: root/cli/cache/parsed_source.rs
diff options
context:
space:
mode:
authorGeert-Jan Zwiers <geertjanzwiers@protonmail.com>2023-01-27 16:16:38 +0100
committerGitHub <noreply@github.com>2023-01-27 20:46:38 +0530
commit1a1faff2f67613ed0b89e1a34e6c3fd02ca6fd83 (patch)
tree71f981c66aa6bf012606ae0654b2dd6c8f0ef563 /cli/cache/parsed_source.rs
parent7f38f30a5c0eb06c5b85d1c7ac26a480c210aab6 (diff)
chore(cli/cache): fewer string allocations (#17549)
Diffstat (limited to 'cli/cache/parsed_source.rs')
-rw-r--r--cli/cache/parsed_source.rs4
1 files changed, 2 insertions, 2 deletions
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)")?;