Use associated types instead of generics

This commit is contained in:
gwenn
2018-05-06 17:19:19 +02:00
parent 10ba0514e6
commit 8e6ea05efa
4 changed files with 24 additions and 10 deletions

View File

@@ -89,7 +89,9 @@ impl CSVTab {
}
}
impl VTab<CSVTabCursor> for CSVTab {
impl VTab for CSVTab {
type Cursor = CSVTabCursor;
unsafe fn connect(db: *mut ffi::sqlite3, _aux: *mut c_void, args: &[&[u8]]) -> Result<CSVTab> {
if args.len() < 4 {
return Err(Error::ModuleError("no CSV file specified".to_owned()));
@@ -246,7 +248,9 @@ impl CSVTabCursor {
}
}
impl VTabCursor<CSVTab> for CSVTabCursor {
impl VTabCursor for CSVTabCursor {
type Table = CSVTab;
fn vtab(&self) -> &CSVTab {
unsafe { & *(self.base.pVtab as *const CSVTab) }
}