Updated for latest Rust.
This commit is contained in:
parent
c9b9988768
commit
a23fcd6ba2
3 changed files with 4 additions and 4 deletions
|
@ -189,7 +189,7 @@ impl Config {
|
||||||
/// This will also panic if used and there are no options.
|
/// This will also panic if used and there are no options.
|
||||||
#[stable]
|
#[stable]
|
||||||
pub fn get_option(&self, option: &str) -> &str {
|
pub fn get_option(&self, option: &str) -> &str {
|
||||||
self.options.as_ref().map(|o| &o[option.to_owned()][..]).unwrap()
|
self.options.as_ref().map(|o| &o[&option.to_owned()][..]).unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ impl<T: IrcRead, U: IrcWrite> IrcServer<T, U> {
|
||||||
if &msg.command[..] == "JOIN" {
|
if &msg.command[..] == "JOIN" {
|
||||||
vec.push(User::new(&src[..i]));
|
vec.push(User::new(&src[..i]));
|
||||||
} else {
|
} else {
|
||||||
if let Some(n) = vec.as_slice().position_elem(&User::new(&src[..i])) {
|
if let Some(n) = vec.position_elem(&User::new(&src[..i])) {
|
||||||
vec.swap_remove(n);
|
vec.swap_remove(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ impl<T: IrcRead, U: IrcWrite> IrcServer<T, U> {
|
||||||
} else if let ("MODE", [ref chan, ref mode, ref user]) = (&msg.command[..], &msg.args[..]) {
|
} else if let ("MODE", [ref chan, ref mode, ref user]) = (&msg.command[..], &msg.args[..]) {
|
||||||
if cfg!(not(feature = "nochanlists")) {
|
if cfg!(not(feature = "nochanlists")) {
|
||||||
if let Some(vec) = self.chanlists.lock().unwrap().get_mut(chan) {
|
if let Some(vec) = self.chanlists.lock().unwrap().get_mut(chan) {
|
||||||
if let Some(n) = vec.as_slice().position_elem(&User::new(&user)) {
|
if let Some(n) = vec.position_elem(&User::new(&user)) {
|
||||||
vec[n].update_access_level(&mode);
|
vec[n].update_access_level(&mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#![feature(collections, core, io, str_char, tcp)]
|
#![feature(collections, core, io, str_char, tcp)]
|
||||||
#[cfg(feature = "ctcp")] extern crate time;
|
#[cfg(feature = "ctcp")] extern crate time;
|
||||||
#[cfg(feature = "encode")] extern crate encoding;
|
#[cfg(feature = "encode")] extern crate encoding;
|
||||||
extern crate "rustc-serialize" as rustc_serialize;
|
extern crate rustc_serialize;
|
||||||
#[cfg(feature = "ssl")] extern crate openssl;
|
#[cfg(feature = "ssl")] extern crate openssl;
|
||||||
|
|
||||||
pub mod client;
|
pub mod client;
|
||||||
|
|
Loading…
Reference in a new issue