chore: Bump Rust edition to 2024 (#27800)

Follow-up to https://github.com/zed-industries/zed/pull/27791

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-03-31 20:55:27 +02:00 committed by GitHub
parent d50905e000
commit dc64ec9cc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
802 changed files with 3775 additions and 3662 deletions

View file

@ -6,7 +6,7 @@ use std::{
ptr,
};
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use libsqlite3_sys::*;
pub struct Connection {
@ -429,12 +429,16 @@ mod test {
fn test_alter_table_syntax() {
let connection = Connection::open_memory(Some("test_alter_table_syntax"));
assert!(connection
.sql_has_syntax_error("ALTER TABLE test ADD x TEXT")
.is_none());
assert!(
connection
.sql_has_syntax_error("ALTER TABLE test ADD x TEXT")
.is_none()
);
assert!(connection
.sql_has_syntax_error("ALTER TABLE test AAD x TEXT")
.is_some());
assert!(
connection
.sql_has_syntax_error("ALTER TABLE test AAD x TEXT")
.is_some()
);
}
}

View file

@ -6,7 +6,7 @@
use std::ffi::CString;
use anyhow::{anyhow, Context as _, Result};
use anyhow::{Context as _, Result, anyhow};
use indoc::{formatdoc, indoc};
use libsqlite3_sys::sqlite3_exec;

View file

@ -76,23 +76,25 @@ mod tests {
connection.with_savepoint("first", || {
connection.exec_bound("INSERT INTO text(text, idx) VALUES (?, ?)")?((save1_text, 1))?;
assert!(connection
.with_savepoint("second", || -> Result<Option<()>, anyhow::Error> {
connection.exec_bound("INSERT INTO text(text, idx) VALUES (?, ?)")?((
save2_text, 2,
))?;
assert!(
connection
.with_savepoint("second", || -> Result<Option<()>, anyhow::Error> {
connection.exec_bound("INSERT INTO text(text, idx) VALUES (?, ?)")?((
save2_text, 2,
))?;
assert_eq!(
connection
.select::<String>("SELECT text FROM text ORDER BY text.idx ASC")?(
)?,
vec![save1_text, save2_text],
);
assert_eq!(
connection
.select::<String>("SELECT text FROM text ORDER BY text.idx ASC")?(
)?,
vec![save1_text, save2_text],
);
anyhow::bail!("Failed second save point :(")
})
.err()
.is_some());
anyhow::bail!("Failed second save point :(")
})
.err()
.is_some()
);
assert_eq!(
connection.select::<String>("SELECT text FROM text ORDER BY text.idx ASC")?()?,

View file

@ -1,8 +1,8 @@
use std::ffi::{c_int, CStr, CString};
use std::ffi::{CStr, CString, c_int};
use std::marker::PhantomData;
use std::{ptr, slice, str};
use anyhow::{anyhow, bail, Context, Result};
use anyhow::{Context, Result, anyhow, bail};
use libsqlite3_sys::*;
use crate::bindable::{Bind, Column};
@ -477,11 +477,13 @@ mod test {
.unwrap()()
.unwrap();
assert!(connection
.select_row::<String>("SELECT text FROM texts")
.unwrap()()
.unwrap()
.is_none());
assert!(
connection
.select_row::<String>("SELECT text FROM texts")
.unwrap()()
.unwrap()
.is_none()
);
let text_to_insert = "This is a test";

View file

@ -1,6 +1,6 @@
use anyhow::Context as _;
use collections::HashMap;
use futures::{channel::oneshot, Future, FutureExt};
use futures::{Future, FutureExt, channel::oneshot};
use parking_lot::{Mutex, RwLock};
use std::{
marker::PhantomData,