From 496cedc9dfdad1c894a91ca0f39c022ac1bd9fb1 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 5 Dec 2021 09:12:22 +0200 Subject: chore: drop unused fields in struct Index At this point, I don't know why the fields were there, but they are now not used at all, so they can be dropped. Sponsored-by: author --- src/index.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/index.rs b/src/index.rs index dae9b78..d76e4a3 100644 --- a/src/index.rs +++ b/src/index.rs @@ -2,8 +2,7 @@ use crate::checksummer::Checksum; use crate::chunkid::ChunkId; use crate::chunkmeta::ChunkMeta; use rusqlite::Connection; -use std::collections::HashMap; -use std::path::{Path, PathBuf}; +use std::path::Path; /// A chunk index. /// @@ -11,11 +10,7 @@ use std::path::{Path, PathBuf}; /// string key/value pair, or whether they are generations. #[derive(Debug)] pub struct Index { - filename: PathBuf, conn: Connection, - map: HashMap<(String, String), Vec>, - generations: Vec, - metas: HashMap, } /// All the errors that may be returned for `Index`. @@ -42,13 +37,7 @@ impl Index { } else { sql::create_db(&filename)? }; - Ok(Self { - filename, - conn, - map: HashMap::new(), - generations: vec![], - metas: HashMap::new(), - }) + Ok(Self { conn }) } pub fn insert_meta(&mut self, id: ChunkId, meta: ChunkMeta) -> Result<(), IndexError> { -- cgit v1.2.1