Skip to content

Commit

Permalink
Merge pull request #68 from steveklabnik/master
Browse files Browse the repository at this point in the history
fail -> panic
  • Loading branch information
sfackler committed Oct 30, 2014
2 parents 4a9ca42 + 7d1be73 commit 867df81
Show file tree
Hide file tree
Showing 5 changed files with 250 additions and 250 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ impl PostgresConnection {
/// let maybe_stmt = conn.prepare("SELECT foo FROM bar WHERE baz = $1");
/// let stmt = match maybe_stmt {
/// Ok(stmt) => stmt,
/// Err(err) => fail!("Error preparing statement: {}", err)
/// Err(err) => panic!("Error preparing statement: {}", err)
/// };
pub fn prepare<'a>(&'a self, query: &str) -> PostgresResult<PostgresStatement<'a>> {
let mut conn = self.conn.borrow_mut();
Expand Down Expand Up @@ -1283,7 +1283,7 @@ impl<'conn> PostgresStatement<'conn> {
/// # let baz = true;
/// let mut rows = match stmt.query(&[&baz]) {
/// Ok(rows) => rows,
/// Err(err) => fail!("Error running query: {}", err)
/// Err(err) => panic!("Error running query: {}", err)
/// };
/// for row in rows {
/// let foo: i32 = row.get("foo");
Expand Down Expand Up @@ -1488,7 +1488,7 @@ impl<'stmt> PostgresRow<'stmt> {
pub fn get<I, T>(&self, idx: I) -> T where I: RowIndex + fmt::Show + Clone, T: FromSql {
match self.get_opt(idx.clone()) {
Ok(ok) => ok,
Err(err) => fail!("error retrieving column {}: {}", idx, err)
Err(err) => panic!("error retrieving column {}: {}", idx, err)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ macro_rules! try_pg_desync(
macro_rules! check_desync(
($e:expr) => ({
if $e.canary() != CANARY {
fail!("PostgresConnection use after free. See mozilla/rust#13246.");
panic!("PostgresConnection use after free. See mozilla/rust#13246.");
}
if $e.is_desynchronized() {
return Err(PgStreamDesynchronized);
Expand Down
2 changes: 1 addition & 1 deletion tests/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use postgres::pool::PostgresConnectionPool;
#[test]
// Make sure we can take both connections at once and can still get one after
fn test_pool() {
let pool = or_fail!(PostgresConnectionPool::new("postgres://postgres@localhost",
let pool = or_panic!(PostgresConnectionPool::new("postgres://postgres@localhost",
NoSsl, 2));

let (s1, r1) = comm::channel();
Expand Down
Loading

0 comments on commit 867df81

Please sign in to comment.