From 62150c5a61389bdb132b866cbe01d17fd0dd533a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 21 Dec 2015 19:13:05 +0100 Subject: [PATCH] Add missing lifetimes --- src/module/bm/mod.rs | 2 +- src/storage/file/mod.rs | 14 +++++++------- src/storage/path.rs | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/module/bm/mod.rs b/src/module/bm/mod.rs index 5316f92b..a390020d 100644 --- a/src/module/bm/mod.rs +++ b/src/module/bm/mod.rs @@ -24,7 +24,7 @@ impl<'a> BM<'a> { } -impl<'a> Module for BM<'a> { +impl<'a> Module<'a> for BM<'a> { fn exec(&self, matches: &ArgMatches) -> bool { unimplemented!() diff --git a/src/storage/file/mod.rs b/src/storage/file/mod.rs index e403be61..898d04b8 100644 --- a/src/storage/file/mod.rs +++ b/src/storage/file/mod.rs @@ -22,7 +22,7 @@ use self::header::data::*; * internally until it is written to disk. */ pub struct File<'a> { - owning_module : &'a Module, + owning_module : &'a Module<'a>, header : FileHeaderData, data : String, id : FileID, @@ -30,7 +30,7 @@ pub struct File<'a> { impl<'a> File<'a> { - pub fn new(module: &'a Module) -> File<'a> { + pub fn new(module: &'a Module<'a>) -> File<'a> { let f = File { owning_module: module, header: FileHeaderData::Null, @@ -41,7 +41,7 @@ impl<'a> File<'a> { f } - pub fn from_parser_result(module: &Module, id: FileID, header: FileHeaderData, data: String) -> File { + pub fn from_parser_result(module: &'a Module<'a>, id: FileID, header: FileHeaderData, data: String) -> File<'a> { let f = File { owning_module: module, header: header, @@ -52,7 +52,7 @@ impl<'a> File<'a> { f } - pub fn new_with_header(module: &Module, h: FileHeaderData) -> File { + pub fn new_with_header(module: &'a Module<'a>, h: FileHeaderData) -> File<'a> { let f = File { owning_module: module, header: h, @@ -63,7 +63,7 @@ impl<'a> File<'a> { f } - pub fn new_with_data(module: &Module, d: String) -> File { + pub fn new_with_data(module: &'a Module<'a>, d: String) -> File<'a> { let f = File { owning_module: module, header: FileHeaderData::Null, @@ -74,7 +74,7 @@ impl<'a> File<'a> { f } - pub fn new_with_content(module: &Module, h: FileHeaderData, d: String) -> File { + pub fn new_with_content(module: &'a Module<'a>, h: FileHeaderData, d: String) -> File<'a> { let f = File { owning_module: module, header: h, @@ -101,7 +101,7 @@ impl<'a> File<'a> { self.id.clone() } - pub fn owner(&self) -> &Module { + pub fn owner(&self) -> &'a Module<'a> { self.owning_module } diff --git a/src/storage/path.rs b/src/storage/path.rs index 484295ac..4b944c4d 100644 --- a/src/storage/path.rs +++ b/src/storage/path.rs @@ -30,7 +30,7 @@ struct Path<'a> { /* * The module */ - module: &'a Module, + module: &'a Module<'a>, /* * The ID @@ -43,7 +43,7 @@ struct Path<'a> { impl<'a> Path<'a> { - fn new(base: PathBuf, store: PathBuf, m: &Module, id: FileID) -> Path { + fn new(base: PathBuf, store: PathBuf, m: &'a Module<'a>, id: FileID) -> Path<'a> { Path { base: base, store: store, @@ -54,7 +54,7 @@ impl<'a> Path<'a> { } } - fn new_with_idtype(base: PathBuf, store: PathBuf, m: &Module, id: FileIDType) -> Path { + fn new_with_idtype(base: PathBuf, store: PathBuf, m: &'a Module<'a>, id: FileIDType) -> Path<'a> { Path { base: base, store: store, @@ -65,7 +65,7 @@ impl<'a> Path<'a> { } } - fn new_with_idhash(base: PathBuf, store: PathBuf, m: &Module, id: FileHash) -> Path { + fn new_with_idhash(base: PathBuf, store: PathBuf, m: &'a Module<'a>, id: FileHash) -> Path<'a> { Path { base: base, store: store,