diff --git a/public/style.css b/public/style.css index 310b8dac6..d2bb0a4a7 100644 --- a/public/style.css +++ b/public/style.css @@ -15,10 +15,6 @@ em { justify-content: center; } -.level-left { - margin-right: 50px; -} - .document { padding: 20px 20px; background-color: #f5f5f5; diff --git a/src/bin/serve.rs b/src/bin/serve.rs index 0f557b850..29a7fb3a2 100644 --- a/src/bin/serve.rs +++ b/src/bin/serve.rs @@ -54,16 +54,11 @@ async fn main() -> anyhow::Result<()> { let index = Index::new(&env)?; - // Retrieve the database the file stem (w/o the extension) + // Retrieve the database the file stem (w/o the extension), + // the disk file size and the number of documents in the database. let db_name = opt.database.file_stem().and_then(|s| s.to_str()).unwrap_or("").to_string(); - - // Retrieve the disk file size let db_size = File::open(opt.database.join("data.mdb"))?.metadata()?.len() as usize; - - // Precompute the number of documents in the database. - let rtxn = env.read_txn().unwrap(); - let docs_count = index.documents.len(&rtxn)?; - drop(rtxn); + let docs_count = env.read_txn().and_then(|r| index.documents.len(&r))?; // We run and wait on the HTTP server diff --git a/templates/index.html b/templates/index.html index e45569462..c9241a371 100644 --- a/templates/index.html +++ b/templates/index.html @@ -21,7 +21,7 @@