Skip to content

Commit e380c52

Browse files
pksunkaraweiznich
authored andcommitted
Merge pull request #4110 from weiznich/fix/4108
Remove the unsound `SerializedDatabase::new` function
1 parent 385c53a commit e380c52

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

diesel/src/sqlite/connection/serialized_database.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ pub struct SerializedDatabase {
1313

1414
impl SerializedDatabase {
1515
/// Creates a new `SerializedDatabase` with the given data pointer and length.
16-
pub fn new(data: *mut u8, len: usize) -> Self {
16+
///
17+
/// SAFETY: The data pointer needs to be returned by sqlite
18+
/// and the length must match the underlying buffer pointer
19+
pub(crate) unsafe fn new(data: *mut u8, len: usize) -> Self {
1720
Self { data, len }
1821
}
1922

0 commit comments

Comments
 (0)