Skip to content

Commit 2e538d4

Browse files
authored
Fix typo and variable names (#3649)
## Motivation There was a small typo in one of the error enums, and also some variable names that sounded confusing to me ## Proposal Fix typo and improve variable names a bit ## Test Plan CI ## Release Plan - Nothing to do / These changes follow the usual release cycle.
1 parent 87cb629 commit 2e538d4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

linera-views/src/backends/dual.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,21 +321,21 @@ where
321321
}
322322

323323
async fn create(config: &Self::Config, namespace: &str) -> Result<(), Self::Error> {
324-
let test1 = S1::exists(&config.first_config, namespace)
324+
let exists1 = S1::exists(&config.first_config, namespace)
325325
.await
326326
.map_err(DualStoreError::First)?;
327-
let test2 = S2::exists(&config.second_config, namespace)
327+
let exists2 = S2::exists(&config.second_config, namespace)
328328
.await
329329
.map_err(DualStoreError::Second)?;
330-
if test1 && test2 {
330+
if exists1 && exists2 {
331331
return Err(DualStoreError::StoreAlreadyExist);
332332
}
333-
if !test1 {
333+
if !exists1 {
334334
S1::create(&config.first_config, namespace)
335335
.await
336336
.map_err(DualStoreError::First)?;
337337
}
338-
if !test2 {
338+
if !exists2 {
339339
S2::create(&config.second_config, namespace)
340340
.await
341341
.map_err(DualStoreError::Second)?;

linera-views/src/backends/rocks_db.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ impl AdminKeyValueStore for RocksDbStoreInternal {
523523
let mut path_buf = config.path_with_guard.path_buf.clone();
524524
path_buf.push(namespace);
525525
if std::path::Path::exists(&path_buf) {
526-
return Err(RocksDbStoreInternalError::StoreAlreadyExist);
526+
return Err(RocksDbStoreInternalError::StoreAlreadyExists);
527527
}
528528
std::fs::create_dir_all(path_buf)?;
529529
Ok(())
@@ -562,9 +562,9 @@ impl TestKeyValueStore for RocksDbStoreInternal {
562562
/// The error type for [`RocksDbStoreInternal`]
563563
#[derive(Error, Debug)]
564564
pub enum RocksDbStoreInternalError {
565-
/// Already existing storage
566-
#[error("Already existing storag")]
567-
StoreAlreadyExist,
565+
/// Store already exists
566+
#[error("Store already exists")]
567+
StoreAlreadyExists,
568568

569569
/// Tokio join error in RocksDB.
570570
#[error("tokio join error: {0}")]

0 commit comments

Comments
 (0)