Skip to content

Commit 599a84a

Browse files
committed
Shuffle unknown type boxing a bit
1 parent 94d0411 commit 599a84a

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,10 +783,10 @@ impl InnerConnection {
783783
rngsubtype
784784
};
785785
let element_type = match elem_oid {
786-
Some(oid) => Some(Box::new(try!(self.get_type(oid)))),
786+
Some(oid) => Some(try!(self.get_type(oid))),
787787
None => None,
788788
};
789-
let type_ = Type::Unknown(ugh_privacy::new_unknown(name, oid, element_type));
789+
let type_ = Type::Unknown(Box::new(ugh_privacy::new_unknown(name, oid, element_type)));
790790
self.unknown_types.insert(oid, type_.clone());
791791
Ok(type_)
792792
}

src/types/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ macro_rules! make_postgres_type {
193193
$variant,
194194
)+
195195
/// An unknown type
196-
Unknown(Unknown),
196+
Unknown(Box<Unknown>),
197197
}
198198

199199
impl fmt::Debug for Type {

src/ugh_privacy.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ use error::{SqlState, ErrorPosition, ConnectError, Error};
1212
pub struct Unknown {
1313
name: String,
1414
oid: Oid,
15-
element_type: Option<Box<Type>>,
15+
element_type: Option<Type>,
1616
}
1717

18-
pub fn new_unknown(name: String, oid: Oid, element_type: Option<Box<Type>>) -> Unknown {
18+
pub fn new_unknown(name: String, oid: Oid, element_type: Option<Type>) -> Unknown {
1919
Unknown {
2020
name: name,
2121
oid: oid,
@@ -36,7 +36,7 @@ impl Unknown {
3636

3737
/// If this type is an array or range, the type of its members.
3838
pub fn element_type(&self) -> Option<&Type> {
39-
self.element_type.as_ref().map(|e| &**e)
39+
self.element_type.as_ref()
4040
}
4141
}
4242

0 commit comments

Comments
 (0)