indexedlog: make create_in_memory take a ref

Summary: This makes OpenOptions reusable. It helps writing shorter tests.

Reviewed By: xavierd

Differential Revision: D17742000

fbshipit-source-id: aa6dd5cd1936ba73d5644ed90cce8f75c71585f7
This commit is contained in:
Jun Wu 2019-10-04 20:33:58 -07:00 committed by Facebook Github Bot
parent dec9087a1c
commit d786f5d557

View File

@ -1653,7 +1653,7 @@ impl OpenOptions {
/// Construct an empty in-memory [`Log`] without side-effects on the
/// filesystem. The in-memory [`Log`] cannot be [`sync`]ed.
pub fn create_in_memory(self) -> crate::Result<Log> {
pub fn create_in_memory(&self) -> crate::Result<Log> {
let result: crate::Result<_> = (|| {
let meta = LogMetadata {
primary_len: PRIMARY_START_OFFSET,