mirror of
https://github.com/isar/rusqlite.git
synced 2025-01-20 03:40:50 +08:00
rustfmt
This commit is contained in:
parent
ea14115d6c
commit
f4c3ba0fa2
@ -489,9 +489,10 @@ impl InnerConnection {
|
|||||||
where D: Aggregate<A, T>,
|
where D: Aggregate<A, T>,
|
||||||
T: ToResult
|
T: ToResult
|
||||||
{
|
{
|
||||||
unsafe fn aggregate_context<A>(ctx: *mut sqlite3_context, bytes: usize) -> Option<*mut *mut A> {
|
unsafe fn aggregate_context<A>(ctx: *mut sqlite3_context,
|
||||||
let pac = ffi::sqlite3_aggregate_context(ctx, bytes as c_int)
|
bytes: usize)
|
||||||
as *mut *mut A;
|
-> Option<*mut *mut A> {
|
||||||
|
let pac = ffi::sqlite3_aggregate_context(ctx, bytes as c_int) as *mut *mut A;
|
||||||
if pac.is_null() {
|
if pac.is_null() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@ -559,12 +560,14 @@ impl InnerConnection {
|
|||||||
// Within the xFinal callback, it is customary to set N=0 in calls to
|
// Within the xFinal callback, it is customary to set N=0 in calls to
|
||||||
// sqlite3_aggregate_context(C,N) so that no pointless memory allocations occur.
|
// sqlite3_aggregate_context(C,N) so that no pointless memory allocations occur.
|
||||||
let a: Option<A> = match aggregate_context(ctx, 0) {
|
let a: Option<A> = match aggregate_context(ctx, 0) {
|
||||||
Some(pac) => if (*pac).is_null() {
|
Some(pac) => {
|
||||||
None
|
if (*pac).is_null() {
|
||||||
} else {
|
None
|
||||||
let a = Box::from_raw(*pac);
|
} else {
|
||||||
Some(*a)
|
let a = Box::from_raw(*pac);
|
||||||
},
|
Some(*a)
|
||||||
|
}
|
||||||
|
}
|
||||||
None => None,
|
None => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user