Skip to content

Commit 8a0eab0

Browse files
committed
Handle option being None
1 parent 99ebda2 commit 8a0eab0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

postgres/src/lib.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -959,13 +959,9 @@ impl InnerConnection {
959959
columns = Some(self.parse_cols(Some(body))?);
960960
}
961961
backend::Message::CommandComplete(_) => {
962-
result.push(
963-
TextRows::new(
964-
// TODO is it safe to unwrap here?
965-
columns.take().unwrap(),
966-
mem::replace(&mut rows, Vec::new())
967-
)
968-
);
962+
if let Some(cols) = columns.take() {
963+
result.push(TextRows::new(cols, mem::replace(&mut rows, Vec::new())));
964+
}
969965
}
970966
_ => {}
971967
}

0 commit comments

Comments
 (0)