Skip to content

Commit

Permalink
chore: remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-herlemont committed Jun 15, 2024
1 parent ec7109b commit 58308fc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/db_type/key/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ impl Key {
/// let r = db.r_transaction()?;
///
/// // Get contry by the capital city (primary key)
/// let _US: Option<Contry> = r.get().primary(&City("Washington, D.C.".to_string()))?;
/// let _us: Option<Contry> = r.get().primary(&City("Washington, D.C.".to_string()))?;
///
/// // Get contry by the bigest city (secondary key)
/// let _US: Option<Contry> = r.get().secondary(ContryKey::bigest_city,&City("New York".to_string()))?;
/// let _us: Option<Contry> = r.get().secondary(ContryKey::bigest_city,&City("New York".to_string()))?;
/// Ok(())
/// }
/// ```
Expand Down
4 changes: 2 additions & 2 deletions src/upgrade/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use crate::{database_instance::DatabaseInstance, db_type::Result, Configuration,
pub(crate) fn upgrade(
database_configuration: &Configuration,
path: impl AsRef<Path>,
model_builder: &HashMap<String, ModelBuilder>,
_model_builder: &HashMap<String, ModelBuilder>,
) -> Result<DatabaseInstance> {
#[cfg(feature = "redb1")]
redb1_to_redb2::upgrade_redb1_to_redb2(&database_configuration, &path, model_builder)?;
redb1_to_redb2::upgrade_redb1_to_redb2(&database_configuration, &path, _model_builder)?;

let redb_builder = database_configuration.new_rdb_builder();
let database_instance = DatabaseInstance::open_on_disk(redb_builder, &path)?;
Expand Down
Binary file modified tests/data/db_0_6_0
Binary file not shown.
4 changes: 1 addition & 3 deletions tests/upgrade/from_0_5_x_to_0_6_x.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use native_db::*;
use native_model::{native_model, Model};
use serde::{Deserialize, Serialize};
use shortcut_assert_fs::TmpFs;

#[derive(Serialize, Deserialize, Eq, PartialEq, Clone, Debug)]
#[native_model(id = 1, version = 1)]
Expand All @@ -28,8 +27,6 @@ struct Item2 {
#[test]
#[cfg(not(feature = "upgrade_0_5_x"))]
fn try_to_open_legacy_database_without_upgrade_feature() {
use assert_fs::assert;

let root_project_path = env!("CARGO_MANIFEST_DIR");
let database_path = format!("{}/tests/data/db_0_5_x", root_project_path);

Expand Down Expand Up @@ -59,6 +56,7 @@ fn try_to_open_legacy_database_with_upgrade_feature() {
PathBuf::from(format!("{}/tests/data/db_0_5_x", root_project_path))
};

use shortcut_assert_fs::TmpFs;
let tmp = TmpFs::new().unwrap();

// Copy the legacy database to the temporary directory.
Expand Down
2 changes: 1 addition & 1 deletion tests/watch_tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async fn watch_one_primary_key() {

let mut models = Models::new();
models.define::<ItemA>().unwrap();
let mut db = Builder::new().create(&models,tf.path("test").as_std_path()).unwrap();
let db = Builder::new().create(&models,tf.path("test").as_std_path()).unwrap();

let a = ItemA { id: 1 };

Expand Down

0 comments on commit 58308fc

Please sign in to comment.