Fixed compilation for rust master.
This commit is contained in:
parent
0257c6f3c0
commit
2dc47006ce
7 changed files with 14 additions and 11 deletions
|
@ -9,7 +9,7 @@ use data::message::{Message, ToMessage};
|
|||
/// [capabilities extension](https://tools.ietf.org/html/draft-mitchell-irc-capabilities-01).
|
||||
/// Additionally, this includes some common additional commands from popular IRCds.
|
||||
#[stable]
|
||||
#[deriving(Show, PartialEq)]
|
||||
#[derive(Show, PartialEq)]
|
||||
pub enum Command<'a> {
|
||||
// 3.1 Connection Registration
|
||||
/// PASS password
|
||||
|
@ -951,7 +951,7 @@ impl<'a> Command<'a> {
|
|||
|
||||
/// A list of all of the subcommands for the capabilities extension.
|
||||
#[stable]
|
||||
#[deriving(Copy, Show, PartialEq)]
|
||||
#[derive(Copy, Show, PartialEq)]
|
||||
pub enum CapSubCommand {
|
||||
/// Requests a list of the server's capabilities.
|
||||
LS,
|
||||
|
|
|
@ -7,7 +7,7 @@ use std::io::{InvalidInput, IoError, IoResult};
|
|||
use rustc_serialize::json::decode;
|
||||
|
||||
/// Configuration data.
|
||||
#[deriving(Clone, RustcDecodable, Default, PartialEq, Show)]
|
||||
#[derive(Clone, RustcDecodable, Default, PartialEq, Show)]
|
||||
#[unstable]
|
||||
pub struct Config {
|
||||
/// A list of the owners of the bot by nickname.
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::str::FromStr;
|
|||
|
||||
/// IRC Message data.
|
||||
#[experimental]
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
pub struct Message {
|
||||
/// The message prefix (or source) as defined by [RFC 2812](http://tools.ietf.org/html/rfc2812).
|
||||
pub prefix: Option<String>,
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
//! Enumeration of all the possible server responses.
|
||||
#![unstable]
|
||||
#![allow(non_camel_case_types)]
|
||||
use std::num::FromPrimitive;
|
||||
use std::str::FromStr;
|
||||
use data::message::Message;
|
||||
|
||||
/// 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.
|
||||
#[deriving(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[repr(uint)]
|
||||
#[unstable]
|
||||
pub enum Response {
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
//! Data for tracking user information.
|
||||
#![unstable]
|
||||
use std::borrow::ToOwned;
|
||||
use std::cmp::Ordering;
|
||||
use std::cmp::Ordering::{Less, Equal, Greater};
|
||||
use std::str::FromStr;
|
||||
|
||||
/// IRC User data.
|
||||
#[unstable]
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct User {
|
||||
/// The user's nickname.
|
||||
/// 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.
|
||||
#[stable]
|
||||
#[deriving(Copy, PartialEq, Clone, Show)]
|
||||
#[derive(Copy, PartialEq, Clone, Show)]
|
||||
pub enum AccessLevel {
|
||||
/// The channel owner (~).
|
||||
Owner,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#![unstable]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
#![feature(slicing_syntax)]
|
||||
#![feature(slicing_syntax, old_orphan_check)]
|
||||
#[cfg(feature = "ctcp")] extern crate time;
|
||||
#[cfg(feature = "encode")] extern crate encoding;
|
||||
extern crate "rustc-serialize" as rustc_serialize;
|
||||
|
|
|
@ -138,11 +138,11 @@ impl<T: IrcReader, U: IrcWriter> IrcServer<T, U> {
|
|||
resp == Response::ERR_ERRONEOUSNICKNAME {
|
||||
let alt_nicks = self.config.get_alternate_nicknames();
|
||||
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.")
|
||||
} else {
|
||||
self.send(NICK(alt_nicks[*index.deref()])).unwrap();
|
||||
*index.deref_mut() += 1;
|
||||
self.send(NICK(alt_nicks[*index])).unwrap();
|
||||
*index += 1;
|
||||
}
|
||||
}
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue