Skip to content

Commit 867df81

Browse files
committed
Merge pull request #68 from steveklabnik/master
fail -> panic
2 parents 4a9ca42 + 7d1be73 commit 867df81

File tree

5 files changed

+250
-250
lines changed

5 files changed

+250
-250
lines changed

src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ impl PostgresConnection {
798798
/// let maybe_stmt = conn.prepare("SELECT foo FROM bar WHERE baz = $1");
799799
/// let stmt = match maybe_stmt {
800800
/// Ok(stmt) => stmt,
801-
/// Err(err) => fail!("Error preparing statement: {}", err)
801+
/// Err(err) => panic!("Error preparing statement: {}", err)
802802
/// };
803803
pub fn prepare<'a>(&'a self, query: &str) -> PostgresResult<PostgresStatement<'a>> {
804804
let mut conn = self.conn.borrow_mut();
@@ -1283,7 +1283,7 @@ impl<'conn> PostgresStatement<'conn> {
12831283
/// # let baz = true;
12841284
/// let mut rows = match stmt.query(&[&baz]) {
12851285
/// Ok(rows) => rows,
1286-
/// Err(err) => fail!("Error running query: {}", err)
1286+
/// Err(err) => panic!("Error running query: {}", err)
12871287
/// };
12881288
/// for row in rows {
12891289
/// let foo: i32 = row.get("foo");
@@ -1488,7 +1488,7 @@ impl<'stmt> PostgresRow<'stmt> {
14881488
pub fn get<I, T>(&self, idx: I) -> T where I: RowIndex + fmt::Show + Clone, T: FromSql {
14891489
match self.get_opt(idx.clone()) {
14901490
Ok(ok) => ok,
1491-
Err(err) => fail!("error retrieving column {}: {}", idx, err)
1491+
Err(err) => panic!("error retrieving column {}: {}", idx, err)
14921492
}
14931493
}
14941494
}

src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ macro_rules! try_pg_desync(
4343
macro_rules! check_desync(
4444
($e:expr) => ({
4545
if $e.canary() != CANARY {
46-
fail!("PostgresConnection use after free. See mozilla/rust#13246.");
46+
panic!("PostgresConnection use after free. See mozilla/rust#13246.");
4747
}
4848
if $e.is_desynchronized() {
4949
return Err(PgStreamDesynchronized);

tests/pool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use postgres::pool::PostgresConnectionPool;
99
#[test]
1010
// Make sure we can take both connections at once and can still get one after
1111
fn test_pool() {
12-
let pool = or_fail!(PostgresConnectionPool::new("postgres://postgres@localhost",
12+
let pool = or_panic!(PostgresConnectionPool::new("postgres://postgres@localhost",
1313
NoSsl, 2));
1414

1515
let (s1, r1) = comm::channel();

0 commit comments

Comments
 (0)