From ced6e647b873a2dcf4d9cf509498ee1b86f56290 Mon Sep 17 00:00:00 2001 From: Antioch Peverell <30642645+antiochp@users.noreply.github.com> Date: Sat, 21 Apr 2018 17:03:45 -0400 Subject: [PATCH] still do not fully understand what PhantomData is *for* exactly (#991) but standardized naming and usage to match https://doc.rust-lang.org/beta/nomicon/phantom-data.html so at least it looks similar to the official docs --- core/src/core/pmmr.rs | 8 ++++---- store/src/lib.rs | 6 +++--- store/src/pmmr.rs | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/src/core/pmmr.rs b/core/src/core/pmmr.rs index bf8e448b5..1ef0a2cb1 100644 --- a/core/src/core/pmmr.rs +++ b/core/src/core/pmmr.rs @@ -36,7 +36,7 @@ //! either be a simple Vec or a database. use std::clone::Clone; -use std::marker::PhantomData; +use std::marker; use core::hash::Hash; use ser; use ser::{Readable, Reader, Writeable, Writer}; @@ -268,7 +268,7 @@ where last_pos: u64, backend: &'a mut B, // only needed for parameterizing Backend - writeable: PhantomData, + _marker: marker::PhantomData, } impl<'a, T, B> PMMR<'a, T, B> @@ -281,7 +281,7 @@ where PMMR { last_pos: 0, backend: backend, - writeable: PhantomData, + _marker: marker::PhantomData, } } @@ -292,7 +292,7 @@ where PMMR { last_pos: last_pos, backend: backend, - writeable: PhantomData, + _marker: marker::PhantomData, } } diff --git a/store/src/lib.rs b/store/src/lib.rs index 8b073da85..59303d09e 100644 --- a/store/src/lib.rs +++ b/store/src/lib.rs @@ -41,7 +41,7 @@ const SEP: u8 = ':' as u8; use std::fmt; use std::iter::Iterator; -use std::marker::PhantomData; +use std::marker; use std::sync::RwLock; use byteorder::{BigEndian, WriteBytesExt}; @@ -167,7 +167,7 @@ impl Store { let db = self.rdb.read().unwrap(); SerIterator { iter: db.iterator(IteratorMode::From(from, Direction::Forward)), - _marker: PhantomData, + _marker: marker::PhantomData, } } @@ -225,7 +225,7 @@ where T: ser::Readable, { iter: DBIterator, - _marker: PhantomData, + _marker: marker::PhantomData, } impl Iterator for SerIterator diff --git a/store/src/pmmr.rs b/store/src/pmmr.rs index d53486ce9..1cc890309 100644 --- a/store/src/pmmr.rs +++ b/store/src/pmmr.rs @@ -15,7 +15,7 @@ use std::fs; use std::io; -use std::marker::PhantomData; +use std::marker; use core::core::pmmr::{self, family, Backend}; use core::ser::{self, PMMRable, Readable, Reader, Writeable, Writer}; @@ -92,7 +92,7 @@ where data_file: AppendOnlyFile, rm_log: RemoveLog, pruned_nodes: pmmr::PruneList, - phantom: PhantomData, + _marker: marker::PhantomData, } impl Backend for PMMRBackend @@ -257,7 +257,7 @@ where pruned_nodes: pmmr::PruneList { pruned_nodes: prune_list, }, - phantom: PhantomData, + _marker: marker::PhantomData, }) }