Skip to content

Rust update: {,Total}{Eq,Ord} → {Partial,}{Eq,Ord} #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bin/cargo-compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use cargo::ops;
use cargo::util::important_paths::find_project;
use cargo::util::ToCLI;

#[deriving(Eq,Clone,Decodable,Encodable)]
#[deriving(PartialEq,Clone,Decodable,Encodable)]
pub struct Options {
manifest_path: Option<String>
}
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo-git-checkout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use cargo::core::source::Source;
use cargo::sources::git::{GitSource,GitRemote};
use url::Url;

#[deriving(Eq,Clone,Decodable)]
#[deriving(PartialEq,Clone,Decodable)]
struct Options {
database_path: String,
checkout_path: String,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo-read-manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use cargo::{execute_main_without_stdin,CLIResult,CLIError};
use cargo::core::Package;
use cargo::ops;

#[deriving(Eq,Clone,Decodable)]
#[deriving(PartialEq,Clone,Decodable)]
struct Options {
manifest_path: String
}
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/core/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use semver::Version;
use core::{VersionReq};
use util::CargoResult;

#[deriving(Eq,Clone,Show)]
#[deriving(PartialEq,Clone,Show)]
pub struct Dependency {
name: String,
req: VersionReq
Expand Down Expand Up @@ -39,7 +39,7 @@ impl Dependency {
}
}

#[deriving(Eq,Clone,Encodable)]
#[deriving(PartialEq,Clone,Encodable)]
pub struct SerializedDependency {
name: String,
req: String
Expand Down
14 changes: 7 additions & 7 deletions src/cargo/core/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use core::{
use core::dependency::SerializedDependency;
use util::CargoResult;

#[deriving(Eq,Clone)]
#[deriving(PartialEq,Clone)]
pub struct Manifest {
summary: Summary,
authors: Vec<String>,
Expand All @@ -26,7 +26,7 @@ impl Show for Manifest {
}
}

#[deriving(Eq,Clone,Encodable)]
#[deriving(PartialEq,Clone,Encodable)]
pub struct SerializedManifest {
name: String,
version: String,
Expand All @@ -49,13 +49,13 @@ impl<E, S: Encoder<E>> Encodable<S, E> for Manifest {
}
}

#[deriving(Show,Clone,Eq,Encodable)]
#[deriving(Show,Clone,PartialEq,Encodable)]
pub enum TargetKind {
LibTarget,
BinTarget
}

#[deriving(Clone,Eq)]
#[deriving(Clone,PartialEq)]
pub struct Target {
kind: TargetKind,
name: String,
Expand Down Expand Up @@ -181,7 +181,7 @@ impl Target {
type TomlLibTarget = TomlTarget;
type TomlBinTarget = TomlTarget;

#[deriving(Decodable,Encodable,Eq,Clone,Show)]
#[deriving(Decodable,Encodable,PartialEq,Clone,Show)]
pub struct Project {
pub name: String,
pub version: String,
Expand All @@ -192,7 +192,7 @@ pub struct Project {
* TODO: Make all struct fields private
*/

#[deriving(Decodable,Encodable,Eq,Clone)]
#[deriving(Decodable,Encodable,PartialEq,Clone)]
pub struct TomlManifest {
project: Box<Project>,
lib: Option<~[TomlLibTarget]>,
Expand Down Expand Up @@ -242,7 +242,7 @@ impl Project {
}
}

#[deriving(Decodable,Encodable,Eq,Clone,Show)]
#[deriving(Decodable,Encodable,PartialEq,Clone,Show)]
struct TomlTarget {
name: String,
path: Option<String>
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/namever.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use serialize::{
Decoder
};

#[deriving(Clone,Eq,Ord)]
#[deriving(Clone,PartialEq,PartialOrd)]
pub struct NameVer {
name: String,
version: semver::Version
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/core/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use core::dependency::SerializedDependency;
use util::graph;
use serialize::{Encoder,Encodable};

#[deriving(Clone,Eq)]
#[deriving(Clone,PartialEq)]
pub struct Package {
// The package's manifest
manifest: Manifest,
Expand Down Expand Up @@ -109,7 +109,7 @@ impl Show for Package {
}
}

#[deriving(Eq,Clone,Show)]
#[deriving(PartialEq,Clone,Show)]
pub struct PackageSet {
packages: Vec<Package>
}
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use core::{
NameVer
};

#[deriving(Show,Clone,Eq)]
#[deriving(Show,Clone,PartialEq)]
pub struct Summary {
name_ver: NameVer,
dependencies: Vec<Dependency>
Expand Down
8 changes: 4 additions & 4 deletions src/cargo/core/version_req.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use std::str::CharOffsets;
use semver::Version;
use util::{other_error,CargoResult};

#[deriving(Eq,Clone)]
#[deriving(PartialEq,Clone)]
pub struct VersionReq {
predicates: Vec<Predicate>
}

#[deriving(Eq,Clone)]
#[deriving(PartialEq,Clone)]
enum Op {
Ex, // Exact
Gt, // Greater than
Expand All @@ -20,7 +20,7 @@ enum Op {
LtEq // Less than or equal to
}

#[deriving(Eq,Clone)]
#[deriving(PartialEq,Clone)]
struct Predicate {
op: Op,
major: uint,
Expand Down Expand Up @@ -225,7 +225,7 @@ struct Lexer<'a> {
state: LexState
}

#[deriving(Show,Eq)]
#[deriving(Show,PartialEq)]
enum LexState {
LexInit,
LexStart,
Expand Down
8 changes: 4 additions & 4 deletions src/cargo/sources/git/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::io::{UserDir,AllPermissions};
use std::io::fs::{mkdir_recursive,rmdir_recursive,chmod};
use serialize::{Encodable,Encoder};

#[deriving(Eq,Clone,Encodable)]
#[deriving(PartialEq,Clone,Encodable)]
pub enum GitReference {
Master,
Other(String)
Expand Down Expand Up @@ -67,13 +67,13 @@ macro_rules! errln(
* GitRemote represents a remote repository. It gets cloned into a local GitDatabase.
*/

#[deriving(Eq,Clone)]
#[deriving(PartialEq,Clone)]
pub struct GitRemote {
url: Url,
verbose: bool
}

#[deriving(Eq,Clone,Encodable)]
#[deriving(PartialEq,Clone,Encodable)]
struct EncodableGitRemote {
url: String
}
Expand All @@ -91,7 +91,7 @@ impl<E, S: Encoder<E>> Encodable<S, E> for GitRemote {
* can be cloned from this GitDatabase.
*/

#[deriving(Eq,Clone)]
#[deriving(PartialEq,Clone)]
pub struct GitDatabase {
remote: GitRemote,
path: Path,
Expand Down
6 changes: 3 additions & 3 deletions src/cargo/util/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use serialize::{Encodable,Encoder};
use toml;
use util::{other_error,CargoResult,Require};

#[deriving(Eq,TotalEq,Clone,Encodable,Decodable)]
#[deriving(PartialEq,Eq,Clone,Encodable,Decodable)]
pub enum Location {
Project,
Global
}

#[deriving(Eq,TotalEq,Clone,Decodable)]
#[deriving(PartialEq,Eq,Clone,Decodable)]
pub enum ConfigValueValue {
String(String),
List(Vec<String>)
Expand Down Expand Up @@ -40,7 +40,7 @@ impl<E, S: Encoder<E>> Encodable<S, E> for ConfigValueValue {
}
}

#[deriving(Eq,TotalEq,Clone,Decodable)]
#[deriving(PartialEq,Eq,Clone,Decodable)]
pub struct ConfigValue {
value: ConfigValueValue,
path: Vec<Path>
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/util/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum Mark {
Done
}

impl<N: TotalEq + Hash + Clone> Graph<N> {
impl<N: Eq + Hash + Clone> Graph<N> {
pub fn new() -> Graph<N> {
Graph { nodes: HashMap::new() }
}
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/util/process_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::io::process::{Command,ProcessOutput,InheritFd};
use util::{CargoResult,io_error,process_error};
use collections::HashMap;

#[deriving(Clone,Eq)]
#[deriving(Clone,PartialEq)]
pub struct ProcessBuilder {
program: String,
args: Vec<String>,
Expand Down
6 changes: 3 additions & 3 deletions src/cargo/util/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn toml_error(desc: &'static str, error: toml::Error) -> CargoError {
}
}

#[deriving(Eq,Clone)]
#[deriving(PartialEq,Clone)]
pub struct CargoError {
pub kind: CargoErrorKind,
desc: CargoErrorDescription,
Expand All @@ -86,7 +86,7 @@ impl Show for CargoError {
}
}

#[deriving(Eq,Show,Clone)]
#[deriving(PartialEq,Show,Clone)]
enum CargoErrorDescription {
StaticDescription(&'static str),
BoxedDescription(String)
Expand Down Expand Up @@ -127,7 +127,7 @@ impl CargoError {
}
}

#[deriving(Eq)]
#[deriving(PartialEq)]
pub enum CargoErrorKind {
HumanReadableError,
InternalError,
Expand Down
8 changes: 4 additions & 4 deletions tests/support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static CARGO_INTEGRATION_TEST_DIR : &'static str = "cargo-integration-tests";
*
*/

#[deriving(Eq,Clone)]
#[deriving(PartialEq,Clone)]
struct FileBuilder {
path: Path,
body: String
Expand All @@ -48,7 +48,7 @@ impl FileBuilder {
}
}

#[deriving(Eq,Clone)]
#[deriving(PartialEq,Clone)]
struct ProjectBuilder {
name: String,
root: Path,
Expand Down Expand Up @@ -156,7 +156,7 @@ pub fn cargo_dir() -> Path {
*
*/

#[deriving(Clone,Eq)]
#[deriving(Clone,PartialEq)]
struct Execs {
expect_stdout: Option<String>,
expect_stdin: Option<String>,
Expand Down Expand Up @@ -248,7 +248,7 @@ pub fn execs() -> Box<Execs> {
}
}

#[deriving(Clone,Eq)]
#[deriving(Clone,PartialEq)]
struct ShellWrites {
expected: String
}
Expand Down