mirror of
https://github.com/isar/rusqlite.git
synced 2025-01-21 00:40:50 +08:00
Rustfmt
This commit is contained in:
parent
59872a1850
commit
6fb549420b
@ -353,7 +353,9 @@ impl<'a> Context<'a> {
|
|||||||
///
|
///
|
||||||
/// `A` is the type of the aggregation context and `T` is the type of the final result.
|
/// `A` is the type of the aggregation context and `T` is the type of the final result.
|
||||||
/// Implementations should be stateless.
|
/// Implementations should be stateless.
|
||||||
pub trait Aggregate<A, T> where T: ToResult {
|
pub trait Aggregate<A, T>
|
||||||
|
where T: ToResult
|
||||||
|
{
|
||||||
/// Initializes the aggregation context. Will be called prior to the first call
|
/// Initializes the aggregation context. Will be called prior to the first call
|
||||||
/// to `step()` to set up the context for an invocation of the function. (Note:
|
/// to `step()` to set up the context for an invocation of the function. (Note:
|
||||||
/// `init()` will not be called if the there are no rows.)
|
/// `init()` will not be called if the there are no rows.)
|
||||||
|
@ -950,7 +950,8 @@ pub struct MappedRows<'stmt, F> {
|
|||||||
map: F,
|
map: F,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'stmt, T, F> Iterator for MappedRows<'stmt, F> where F: FnMut(&Row) -> T
|
impl<'stmt, T, F> Iterator for MappedRows<'stmt, F>
|
||||||
|
where F: FnMut(&Row) -> T
|
||||||
{
|
{
|
||||||
type Item = Result<T>;
|
type Item = Result<T>;
|
||||||
|
|
||||||
|
@ -18,11 +18,19 @@ pub fn load_module(conn: &Connection) -> Result<()> {
|
|||||||
conn.create_module("csv", &CSV_MODULE, aux)
|
conn.create_module("csv", &CSV_MODULE, aux)
|
||||||
}
|
}
|
||||||
|
|
||||||
init_module!(CSV_MODULE, CSVTab, CSVTabCursor,
|
init_module!(CSV_MODULE,
|
||||||
csv_create, csv_best_index, csv_destroy,
|
CSVTab,
|
||||||
csv_open, csv_close,
|
CSVTabCursor,
|
||||||
csv_filter, csv_next, csv_eof,
|
csv_create,
|
||||||
csv_column, csv_rowid);
|
csv_best_index,
|
||||||
|
csv_destroy,
|
||||||
|
csv_open,
|
||||||
|
csv_close,
|
||||||
|
csv_filter,
|
||||||
|
csv_next,
|
||||||
|
csv_eof,
|
||||||
|
csv_column,
|
||||||
|
csv_rowid);
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct CSVTab {
|
struct CSVTab {
|
||||||
|
@ -29,11 +29,19 @@ pub fn drop_int_array(conn: &Connection, name: &str) -> Result<()> {
|
|||||||
conn.execute_batch(&format!("DROP TABLE temp.\"{0}\"", escape_double_quote(name)))
|
conn.execute_batch(&format!("DROP TABLE temp.\"{0}\"", escape_double_quote(name)))
|
||||||
}
|
}
|
||||||
|
|
||||||
init_module!(INT_ARRAY_MODULE, IntArrayVTab, IntArrayVTabCursor,
|
init_module!(INT_ARRAY_MODULE,
|
||||||
int_array_create, int_array_best_index, int_array_destroy,
|
IntArrayVTab,
|
||||||
int_array_open, int_array_close,
|
IntArrayVTabCursor,
|
||||||
int_array_filter, int_array_next, int_array_eof,
|
int_array_create,
|
||||||
int_array_column, int_array_rowid);
|
int_array_best_index,
|
||||||
|
int_array_destroy,
|
||||||
|
int_array_open,
|
||||||
|
int_array_close,
|
||||||
|
int_array_filter,
|
||||||
|
int_array_next,
|
||||||
|
int_array_eof,
|
||||||
|
int_array_column,
|
||||||
|
int_array_rowid);
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct IntArrayVTab {
|
struct IntArrayVTab {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user