From 20fed1956edd75cd17e4c896fb40c98105c2cc98 Mon Sep 17 00:00:00 2001 From: gwenn Date: Sat, 2 Feb 2019 11:10:08 +0100 Subject: [PATCH] Rename some static variables --- src/hooks.rs | 18 +++++++++--------- src/session.rs | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/hooks.rs b/src/hooks.rs index 3ca3345..3131462 100644 --- a/src/hooks.rs +++ b/src/hooks.rs @@ -243,15 +243,15 @@ mod test { let db = Connection::open_in_memory().unwrap(); lazy_static! { - static ref called: AtomicBool = AtomicBool::new(false); + static ref CALLED: AtomicBool = AtomicBool::new(false); } db.commit_hook(Some(|| { - called.store(true, Ordering::Relaxed); + CALLED.store(true, Ordering::Relaxed); false })); db.execute_batch("BEGIN; CREATE TABLE foo (t TEXT); COMMIT;") .unwrap(); - assert!(called.load(Ordering::Relaxed)); + assert!(CALLED.load(Ordering::Relaxed)); } #[test] @@ -272,14 +272,14 @@ mod test { let db = Connection::open_in_memory().unwrap(); lazy_static! { - static ref called: AtomicBool = AtomicBool::new(false); + static ref CALLED: AtomicBool = AtomicBool::new(false); } db.rollback_hook(Some(|| { - called.store(true, Ordering::Relaxed); + CALLED.store(true, Ordering::Relaxed); })); db.execute_batch("BEGIN; CREATE TABLE foo (t TEXT); ROLLBACK;") .unwrap(); - assert!(called.load(Ordering::Relaxed)); + assert!(CALLED.load(Ordering::Relaxed)); } #[test] @@ -287,17 +287,17 @@ mod test { let db = Connection::open_in_memory().unwrap(); lazy_static! { - static ref called: AtomicBool = AtomicBool::new(false); + static ref CALLED: AtomicBool = AtomicBool::new(false); } db.update_hook(Some(|action, db: &str, tbl: &str, row_id| { assert_eq!(Action::SQLITE_INSERT, action); assert_eq!("main", db); assert_eq!("foo", tbl); assert_eq!(1, row_id); - called.store(true, Ordering::Relaxed); + CALLED.store(true, Ordering::Relaxed); })); db.execute_batch("CREATE TABLE foo (t TEXT)").unwrap(); db.execute_batch("INSERT INTO foo VALUES ('lisa')").unwrap(); - assert!(called.load(Ordering::Relaxed)); + assert!(CALLED.load(Ordering::Relaxed)); } } diff --git a/src/session.rs b/src/session.rs index 06ad8a7..70a9f53 100644 --- a/src/session.rs +++ b/src/session.rs @@ -797,19 +797,19 @@ mod test { .unwrap(); lazy_static! { - static ref called: AtomicBool = AtomicBool::new(false); + static ref CALLED: AtomicBool = AtomicBool::new(false); } db.apply( &changeset, None:: bool>, |_conflict_type, _item| { - called.store(true, Ordering::Relaxed); + CALLED.store(true, Ordering::Relaxed); ConflictAction::SQLITE_CHANGESET_OMIT }, ) .unwrap(); - assert!(!called.load(Ordering::Relaxed)); + assert!(!CALLED.load(Ordering::Relaxed)); let check = db .query_row("SELECT 1 FROM foo WHERE t = ?", &["bar"], |row| { row.get::<_, i32>(0) @@ -822,7 +822,7 @@ mod test { &changeset, None:: bool>, |conflict_type, item| { - called.store(true, Ordering::Relaxed); + CALLED.store(true, Ordering::Relaxed); assert_eq!(ConflictType::SQLITE_CHANGESET_CONFLICT, conflict_type); let conflict = item.conflict(0).unwrap(); assert_eq!(Ok("bar"), conflict.as_str()); @@ -830,7 +830,7 @@ mod test { }, ) .unwrap(); - assert!(called.load(Ordering::Relaxed)); + assert!(CALLED.load(Ordering::Relaxed)); } #[test]