I hereby claim:
- I am akr4 on github.
- I am akr4 (https://keybase.io/akr4) on keybase.
- I have a public key ASDy2rbkgMGELpnY2TMrZiXjH5F5N1ezWt1HMB2K-0f-igo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#[derive(PartialEq, Eq, Clone, Debug)] | |
pub struct ListNode { | |
pub val: i32, | |
pub next: Option<Box<ListNode>>, | |
} | |
impl ListNode { | |
#[inline] | |
fn new(val: i32) -> Self { | |
ListNode { next: None, val } |
use std::cell::RefCell; | |
#[cfg(test)] | |
use std::collections::LinkedList; | |
use std::rc::Rc; | |
#[derive(Debug, PartialEq, Eq)] | |
pub struct TreeNode { | |
pub val: i32, | |
pub left: Option<Rc<RefCell<TreeNode>>>, | |
pub right: Option<Rc<RefCell<TreeNode>>>, |
use sqlx::sqlite::SqlitePoolOptions; | |
use anyhow::Result; | |
use sqlx::{Row, SqlitePool}; | |
fn main() {} | |
#[tokio::test] | |
async fn test() -> Result<()> { | |
const LOOP_COUNT: usize = 10; | |
let db_dir = tempfile::tempdir()?; |
//! A reproducer of the 'database is locked' error. | |
//! https://www2.sqlite.org/cvstrac/wiki?p=DatabaseIsLocked | |
//! | |
//! The error happens like this: | |
//! ``` | |
//! thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Database(SqliteError { code: 5, message: "database is locked" })', src/bin/multiple.rs:35:22 | |
//! ``` | |
//! The code is "5", while the wiki page says it is 6. | |
//! | |
//! ```toml |