Merge pull request #1029 from laptou/master

allow `BorrowToSql` for non-static `Box<dyn ToSql>`
This commit is contained in:
Steven Fackler 2023-05-07 13:52:52 -04:00 committed by GitHub
commit 22469d6b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -55,7 +55,7 @@ jobs:
- run: docker compose up -d - run: docker compose up -d
- uses: sfackler/actions/rustup@master - uses: sfackler/actions/rustup@master
with: with:
version: 1.64.0 version: 1.65.0
- run: echo "version=$(rustc --version)" >> $GITHUB_OUTPUT - run: echo "version=$(rustc --version)" >> $GITHUB_OUTPUT
id: rust-version id: rust-version
- uses: actions/cache@v3 - uses: actions/cache@v3

View File

@ -1184,17 +1184,17 @@ impl BorrowToSql for &dyn ToSql {
} }
} }
impl sealed::Sealed for Box<dyn ToSql + Sync> {} impl<'a> sealed::Sealed for Box<dyn ToSql + Sync + 'a> {}
impl BorrowToSql for Box<dyn ToSql + Sync> { impl<'a> BorrowToSql for Box<dyn ToSql + Sync + 'a> {
#[inline] #[inline]
fn borrow_to_sql(&self) -> &dyn ToSql { fn borrow_to_sql(&self) -> &dyn ToSql {
self.as_ref() self.as_ref()
} }
} }
impl sealed::Sealed for Box<dyn ToSql + Sync + Send> {} impl<'a> sealed::Sealed for Box<dyn ToSql + Sync + Send + 'a> {}
impl BorrowToSql for Box<dyn ToSql + Sync + Send> { impl<'a> BorrowToSql for Box<dyn ToSql + Sync + Send + 'a> {
#[inline] #[inline]
fn borrow_to_sql(&self) -> &dyn ToSql { fn borrow_to_sql(&self) -> &dyn ToSql {
self.as_ref() self.as_ref()