Fixed compilation for rust master.

This commit is contained in:
Aaron Weiss 2015-01-04 01:18:26 -05:00
parent 0257c6f3c0
commit 2dc47006ce
7 changed files with 14 additions and 11 deletions

View file

@ -9,7 +9,7 @@ use data::message::{Message, ToMessage};
/// [capabilities extension](https://tools.ietf.org/html/draft-mitchell-irc-capabilities-01). /// [capabilities extension](https://tools.ietf.org/html/draft-mitchell-irc-capabilities-01).
/// Additionally, this includes some common additional commands from popular IRCds. /// Additionally, this includes some common additional commands from popular IRCds.
#[stable] #[stable]
#[deriving(Show, PartialEq)] #[derive(Show, PartialEq)]
pub enum Command<'a> { pub enum Command<'a> {
// 3.1 Connection Registration // 3.1 Connection Registration
/// PASS password /// PASS password
@ -951,7 +951,7 @@ impl<'a> Command<'a> {
/// A list of all of the subcommands for the capabilities extension. /// A list of all of the subcommands for the capabilities extension.
#[stable] #[stable]
#[deriving(Copy, Show, PartialEq)] #[derive(Copy, Show, PartialEq)]
pub enum CapSubCommand { pub enum CapSubCommand {
/// Requests a list of the server's capabilities. /// Requests a list of the server's capabilities.
LS, LS,

View file

@ -7,7 +7,7 @@ use std::io::{InvalidInput, IoError, IoResult};
use rustc_serialize::json::decode; use rustc_serialize::json::decode;
/// Configuration data. /// Configuration data.
#[deriving(Clone, RustcDecodable, Default, PartialEq, Show)] #[derive(Clone, RustcDecodable, Default, PartialEq, Show)]
#[unstable] #[unstable]
pub struct Config { pub struct Config {
/// A list of the owners of the bot by nickname. /// A list of the owners of the bot by nickname.

View file

@ -5,7 +5,7 @@ use std::str::FromStr;
/// IRC Message data. /// IRC Message data.
#[experimental] #[experimental]
#[deriving(Clone, PartialEq, Show)] #[derive(Clone, PartialEq, Show)]
pub struct Message { pub struct Message {
/// The message prefix (or source) as defined by [RFC 2812](http://tools.ietf.org/html/rfc2812). /// The message prefix (or source) as defined by [RFC 2812](http://tools.ietf.org/html/rfc2812).
pub prefix: Option<String>, pub prefix: Option<String>,

View file

@ -1,12 +1,13 @@
//! Enumeration of all the possible server responses. //! Enumeration of all the possible server responses.
#![unstable] #![unstable]
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
use std::num::FromPrimitive;
use std::str::FromStr; use std::str::FromStr;
use data::message::Message; use data::message::Message;
/// List of all server responses as defined in [RFC 2812](http://tools.ietf.org/html/rfc2812). /// List of all server responses as defined in [RFC 2812](http://tools.ietf.org/html/rfc2812).
/// All commands are documented with their expected form from the RFC. /// All commands are documented with their expected form from the RFC.
#[deriving(Copy, Show, PartialEq, FromPrimitive)] #[derive(Copy, Show, PartialEq, FromPrimitive)]
#[repr(uint)] #[repr(uint)]
#[unstable] #[unstable]
pub enum Response { pub enum Response {

View file

@ -1,11 +1,13 @@
//! Data for tracking user information. //! Data for tracking user information.
#![unstable] #![unstable]
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::cmp::Ordering;
use std::cmp::Ordering::{Less, Equal, Greater};
use std::str::FromStr; use std::str::FromStr;
/// IRC User data. /// IRC User data.
#[unstable] #[unstable]
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct User { pub struct User {
/// The user's nickname. /// The user's nickname.
/// This is the only detail used in determining the equality of two users. /// This is the only detail used in determining the equality of two users.
@ -108,7 +110,7 @@ impl PartialEq for User {
/// The user's access level. /// The user's access level.
#[stable] #[stable]
#[deriving(Copy, PartialEq, Clone, Show)] #[derive(Copy, PartialEq, Clone, Show)]
pub enum AccessLevel { pub enum AccessLevel {
/// The channel owner (~). /// The channel owner (~).
Owner, Owner,

View file

@ -4,7 +4,7 @@
#![unstable] #![unstable]
#![warn(missing_docs)] #![warn(missing_docs)]
#![feature(slicing_syntax)] #![feature(slicing_syntax, old_orphan_check)]
#[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" as rustc_serialize;

View file

@ -138,11 +138,11 @@ impl<T: IrcReader, U: IrcWriter> IrcServer<T, U> {
resp == Response::ERR_ERRONEOUSNICKNAME { resp == Response::ERR_ERRONEOUSNICKNAME {
let alt_nicks = self.config.get_alternate_nicknames(); let alt_nicks = self.config.get_alternate_nicknames();
let mut index = self.alt_nick_index.write().unwrap(); let mut index = self.alt_nick_index.write().unwrap();
if *index.deref() >= alt_nicks.len() { if *index >= alt_nicks.len() {
panic!("All specified nicknames were in use.") panic!("All specified nicknames were in use.")
} else { } else {
self.send(NICK(alt_nicks[*index.deref()])).unwrap(); self.send(NICK(alt_nicks[*index])).unwrap();
*index.deref_mut() += 1; *index += 1;
} }
} }
return return