mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-19 16:44:07 +00:00
groundwork for 0.9.0-alpha.1 (#3821)
* chore: bump version to `0.9.0-alpha.1` * chore: delete unused `sqlx-bench` package * chore: set `rust-version` to 1.85 for all crates * fix: lots of new Clippy warnings * fix: lots more Clippy warnings * fix(cli): add `_sqlite` feature * fix: lots, *lots* more Clippy warnings * fix(core): warning in `tls_rustls` * breaking: delete runtime+TLS combination features * chore: don't re-export unstable `TransactionManager` trait * chore: 0.9.0-alplha.1 CHANGELOG * chore: increase MSRV further to 1.86 * fix: more clippy warnings
This commit is contained in:
@@ -7,8 +7,7 @@ license.workspace = true
|
||||
edition.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
rust-version.workspace = true
|
||||
|
||||
[features]
|
||||
any = ["sqlx-core/any"]
|
||||
|
||||
@@ -24,9 +24,11 @@ impl<V> IntMap<V> {
|
||||
}
|
||||
|
||||
pub(crate) fn expand(&mut self, size: i64) -> usize {
|
||||
let idx = size.try_into().expect("negative column index unsupported");
|
||||
while self.0.len() <= idx {
|
||||
self.0.push(None);
|
||||
let idx = usize::try_from(size).expect("negative column index unsupported");
|
||||
if idx >= self.0.len() {
|
||||
let new_len = idx.checked_add(1).expect("idx + 1 overflowed");
|
||||
|
||||
self.0.resize_with(new_len, || None);
|
||||
}
|
||||
idx
|
||||
}
|
||||
@@ -95,15 +97,9 @@ impl<V> IntMap<V> {
|
||||
}
|
||||
|
||||
impl<V: Default> IntMap<V> {
|
||||
pub(crate) fn get_mut_or_default<'a>(&'a mut self, idx: &i64) -> &'a mut V {
|
||||
pub(crate) fn get_mut_or_default(&mut self, idx: &i64) -> &mut V {
|
||||
let idx: usize = self.expand(*idx);
|
||||
|
||||
let item: &mut Option<V> = &mut self.0[idx];
|
||||
if item.is_none() {
|
||||
*item = Some(V::default());
|
||||
}
|
||||
|
||||
return self.0[idx].as_mut().unwrap();
|
||||
self.0[idx].get_or_insert_default()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +128,7 @@ impl<V: Eq> IntMap<V> {
|
||||
0
|
||||
};
|
||||
self.iter()
|
||||
.chain(std::iter::repeat(None).take(self_pad))
|
||||
.chain(std::iter::repeat_n(None, self_pad))
|
||||
.zip(prev.iter().chain(std::iter::repeat(None)))
|
||||
.enumerate()
|
||||
.filter(|(_i, (n, p))| n != p)
|
||||
|
||||
@@ -145,14 +145,14 @@ impl ConnectionWorker {
|
||||
let _guard = span.enter();
|
||||
match cmd {
|
||||
Command::Prepare { query, tx } => {
|
||||
tx.send(prepare(&mut conn, &query).map(|prepared| {
|
||||
update_cached_statements_size(
|
||||
&conn,
|
||||
&shared.cached_statements_size,
|
||||
);
|
||||
prepared
|
||||
}))
|
||||
.ok();
|
||||
tx.send(prepare(&mut conn, &query)).ok();
|
||||
|
||||
// This may issue an unnecessary write on failure,
|
||||
// but it doesn't matter in the grand scheme of things.
|
||||
update_cached_statements_size(
|
||||
&conn,
|
||||
&shared.cached_statements_size,
|
||||
);
|
||||
}
|
||||
Command::Describe { query, tx } => {
|
||||
tx.send(describe(&mut conn, &query)).ok();
|
||||
|
||||
@@ -436,7 +436,7 @@ impl<'q, R: Debug, S: Debug + DebugDiff, P: Debug> QueryPlanLogger<'q, R, S, P>
|
||||
}
|
||||
}
|
||||
|
||||
impl<'q, R: Debug, S: Debug + DebugDiff, P: Debug> Drop for QueryPlanLogger<'q, R, S, P> {
|
||||
impl<R: Debug, S: Debug + DebugDiff, P: Debug> Drop for QueryPlanLogger<'_, R, S, P> {
|
||||
fn drop(&mut self) {
|
||||
self.finish();
|
||||
}
|
||||
|
||||
@@ -108,8 +108,8 @@ pub(crate) struct ValueHandle<'a> {
|
||||
}
|
||||
|
||||
// SAFE: only protected value objects are stored in SqliteValue
|
||||
unsafe impl<'a> Send for ValueHandle<'a> {}
|
||||
unsafe impl<'a> Sync for ValueHandle<'a> {}
|
||||
unsafe impl Send for ValueHandle<'_> {}
|
||||
unsafe impl Sync for ValueHandle<'_> {}
|
||||
|
||||
impl ValueHandle<'static> {
|
||||
fn new_owned(value: NonNull<sqlite3_value>, type_info: SqliteTypeInfo) -> Self {
|
||||
@@ -122,7 +122,7 @@ impl ValueHandle<'static> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ValueHandle<'a> {
|
||||
impl ValueHandle<'_> {
|
||||
fn new_borrowed(value: NonNull<sqlite3_value>, type_info: SqliteTypeInfo) -> Self {
|
||||
Self {
|
||||
value,
|
||||
@@ -185,7 +185,7 @@ impl<'a> ValueHandle<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Drop for ValueHandle<'a> {
|
||||
impl Drop for ValueHandle<'_> {
|
||||
fn drop(&mut self) {
|
||||
if self.free_on_drop {
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user