Add Hash implementation to Type

This commit is contained in:
Michael P. Jung 2019-11-18 15:57:09 +01:00
parent a22f63b5bb
commit edd9a5aa7f
3 changed files with 7 additions and 7 deletions

View File

@ -266,7 +266,7 @@ use std::sync::Arc;
use crate::{{Type, Oid, Kind}};
#[derive(PartialEq, Eq, Debug)]
#[derive(PartialEq, Eq, Debug, Hash)]
pub struct Other {{
pub name: String,
pub oid: Oid,
@ -282,7 +282,7 @@ fn make_enum(w: &mut BufWriter<File>, types: &BTreeMap<u32, Type>) {
write!(
w,
"
#[derive(PartialEq, Eq, Clone, Debug)]
#[derive(PartialEq, Eq, Clone, Debug, Hash)]
pub enum Inner {{"
)
.unwrap();

View File

@ -209,7 +209,7 @@ mod special;
mod type_gen;
/// A Postgres type.
#[derive(PartialEq, Eq, Clone, Debug)]
#[derive(PartialEq, Eq, Clone, Debug, Hash)]
pub struct Type(Inner);
impl fmt::Display for Type {
@ -264,7 +264,7 @@ impl Type {
}
/// Represents the kind of a Postgres type.
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Kind {
/// A simple type like `VARCHAR` or `INTEGER`.
Simple,
@ -285,7 +285,7 @@ pub enum Kind {
}
/// Information about a field of a composite type.
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Field {
name: String,
type_: Type,

View File

@ -3,7 +3,7 @@ use std::sync::Arc;
use crate::{Kind, Oid, Type};
#[derive(PartialEq, Eq, Debug)]
#[derive(PartialEq, Eq, Debug, Hash)]
pub struct Other {
pub name: String,
pub oid: Oid,
@ -11,7 +11,7 @@ pub struct Other {
pub schema: String,
}
#[derive(PartialEq, Eq, Clone, Debug)]
#[derive(PartialEq, Eq, Clone, Debug, Hash)]
pub enum Inner {
Bool,
Bytea,