Skip to content

Commit fcc2768

Browse files
committed
Second half of infrastructure for Connection::query
There are weird dropck issues introduced here that require those extra semicolons in the test code.
1 parent f02cf54 commit fcc2768

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/rows.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use message::FrontendMessage::*;
1616

1717
enum StatementContainer<'a> {
1818
Borrowed(&'a Statement<'a>),
19+
Owned(Statement<'a>),
1920
}
2021

2122
impl<'a> Deref for StatementContainer<'a> {
@@ -24,6 +25,7 @@ impl<'a> Deref for StatementContainer<'a> {
2425
fn deref(&self) -> &Statement<'a> {
2526
match *self {
2627
StatementContainer::Borrowed(s) => s,
28+
StatementContainer::Owned(ref s) => s,
2729
}
2830
}
2931
}

tests/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ FROM (SELECT gs.i
385385
Err(Error::DbError(ref e)) if e.code() == &CardinalityViolation => {}
386386
Err(err) => panic!("Unexpected error {:?}", err),
387387
Ok(_) => panic!("Expected failure"),
388-
}
388+
};
389389
}
390390

391391
#[test]
@@ -751,7 +751,7 @@ fn test_execute_copy_from_err() {
751751
Err(Error::DbError(ref err)) if err.message().contains("COPY") => {}
752752
Err(err) => panic!("Unexpected error {:?}", err),
753753
_ => panic!("Expected error"),
754-
}
754+
};
755755
}
756756

757757
#[test]
@@ -810,7 +810,7 @@ fn test_query_copy_out_err() {
810810
Ok(_) => panic!("unexpected success"),
811811
Err(Error::IoError(ref e)) if e.to_string().contains("COPY") => {}
812812
Err(e) => panic!("unexpected error {:?}", e),
813-
}
813+
};
814814
}
815815

816816
#[test]

tests/types/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ fn test_slice_wrong_type() {
219219
Ok(_) => panic!("Unexpected success"),
220220
Err(Error::WrongType(..)) => {}
221221
Err(e) => panic!("Unexpected error {:?}", e),
222-
}
222+
};
223223
}
224224

225225
#[test]
@@ -231,5 +231,5 @@ fn test_slice_range() {
231231
Ok(_) => panic!("Unexpected success"),
232232
Err(Error::WrongType(..)) => {}
233233
Err(e) => panic!("Unexpected error {:?}", e),
234-
}
234+
};
235235
}

0 commit comments

Comments
 (0)