-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed args of prepare methods to be slices (#1933)
Since there's an opportunity to break more things for `0.13` I decided to improve the `prepare` and `prepare_mut` methods as well. The motivation for that is the same as for #1858, `&[]` requires no heap allocations on the heap if there's a fixed set of arguments.
- Loading branch information
1 parent
7ca80af
commit c1e5dd9
Showing
5 changed files
with
18 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pgrx-tests/tests/compile-fail/escaping-spiclient-1209-prep-stmt.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
error: lifetime may not live long enough | ||
--> tests/compile-fail/escaping-spiclient-1209-prep-stmt.rs:8:39 | ||
| | ||
8 | let prepared = { Spi::connect(|c| c.prepare(q, None))? }; | ||
| -- ^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2` | ||
8 | let prepared = { Spi::connect(|c| c.prepare(q, &[]))? }; | ||
| -- ^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2` | ||
| || | ||
| |return type of closure is std::result::Result<pgrx::spi::PreparedStatement<'2>, pgrx::spi::SpiError> | ||
| has type `SpiClient<'1>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters