Add missing lifetimes

This commit is contained in:
Matthias Beyer 2015-12-21 19:13:05 +01:00
parent 63bbede00f
commit 62150c5a61
3 changed files with 12 additions and 12 deletions

View File

@ -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!()

View File

@ -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
}

View File

@ -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,