Created
September 8, 2012 23:07
-
-
Save killerswan/3680780 to your computer and use it in GitHub Desktop.
sqlite3 Rust bindings, with a slight change...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ rustc --test sqlite.rc | |
| sqlite.rs:605:31: 605:43 error: mismatched types: expected `sqlite_bind_arg` but found `&sqlite_bind_arg` (expected enum sqlite_bind_arg but found &-ptr) | |
| sqlite.rs:605 assert x.get(~"id") == &integer(2); | |
| ^~~~~~~~~~~~ | |
| sqlite.rs:606:31: 606:43 error: mismatched types: expected `sqlite_bind_arg` but found `&sqlite_bind_arg` (expected enum sqlite_bind_arg but found &-ptr) | |
| sqlite.rs:606 assert x.get(~"k") == &text(~"e"); | |
| ^~~~~~~~~~~~ | |
| sqlite.rs:607:31: 607:45 error: mismatched types: expected `sqlite_bind_arg` but found `&sqlite_bind_arg` (expected enum sqlite_bind_arg but found &-ptr) | |
| sqlite.rs:607 assert x.get(~"v") == &number(2.17); | |
| ^~~~~~~~~~~~~~ | |
| sqlite.rs:605:15: 605:43 error: failed to find an implementation of trait @core::cmp::Eq for sqlite_bind_arg | |
| sqlite.rs:605 assert x.get(~"id") == &integer(2); | |
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| match possible_row { | |
| row(x) => { | |
| // x is a map::hashmap<~str, sqlite_bind_arg> | |
| assert x.get(~"id") == &integer(2); | |
| assert x.get(~"k") == &text(~"e"); | |
| assert x.get(~"v") == &number(2.17); | |
| } | |
| done => { | |
| fail(~"didnt get even one row back."); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment