config(...) returns a reference instead of a copy of the value.
This commit is contained in:
parent
95a3a8d6b6
commit
af1f8ecf14
1 changed files with 3 additions and 3 deletions
|
@ -23,7 +23,7 @@ pub trait Bot<'a> {
|
|||
fn send_privmsg(&self, chan: &str, msg: &str) -> IoResult<()>;
|
||||
fn identify(&self) -> IoResult<()>;
|
||||
fn output(&mut self) -> IoResult<()>;
|
||||
fn config(&self) -> Config;
|
||||
fn config(&self) -> &Config;
|
||||
}
|
||||
|
||||
pub struct IrcBot<'a, T, U> where T: IrcWriter, U: IrcReader {
|
||||
|
@ -97,8 +97,8 @@ impl<'a, T, U> Bot<'a> for IrcBot<'a, T, U> where T: IrcWriter, U: IrcReader {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn config(&self) -> Config {
|
||||
self.config.clone()
|
||||
fn config(&self) -> &Config {
|
||||
&self.config
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue