Skip to content

Commit da3d3d9

Browse files
committed
allow manual c string literal
1 parent 6a6af6a commit da3d3d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

stdlib/src/sqlite.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,9 @@ mod _sqlite {
10041004
)
10051005
}
10061006

1007+
// TODO: Make it build without clippy::manual_c_str_literals
10071008
#[pymethod]
1009+
#[allow(clippy::manual_c_str_literals)]
10081010
fn backup(zelf: &Py<Self>, args: BackupArgs, vm: &VirtualMachine) -> PyResult<()> {
10091011
let BackupArgs {
10101012
target,
@@ -1026,7 +1028,7 @@ mod _sqlite {
10261028
name_cstring = name.to_cstring(vm)?;
10271029
name_cstring.as_ptr()
10281030
} else {
1029-
c"main".as_ptr().cast()
1031+
b"main\0".as_ptr().cast()
10301032
};
10311033

10321034
let sleep_ms = (sleep * 1000.0) as c_int;
@@ -1035,7 +1037,7 @@ mod _sqlite {
10351037
let target_db = target.db_lock(vm)?;
10361038

10371039
let handle = unsafe {
1038-
sqlite3_backup_init(target_db.db, c"main".as_ptr().cast(), db.db, name_ptr)
1040+
sqlite3_backup_init(target_db.db, b"main\0".as_ptr().cast(), db.db, name_ptr)
10391041
};
10401042

10411043
if handle.is_null() {

0 commit comments

Comments
 (0)