summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-11-20 10:20:33 +0200
committerLars Wirzenius <liw@liw.fi>2021-11-20 10:20:33 +0200
commit1f2072e07a7e8b52f3a70453e7216b2b81590ba1 (patch)
tree3f0c64267d8116ad4b9f86e46ae1d4667c2bab6e
parent7ff672f26e91404b71edfc25d6b27a6cda11609b (diff)
downloadobnam2-1f2072e07a7e8b52f3a70453e7216b2b81590ba1.tar.gz
chore: bump dependency on rusqlite to 0.26.1 and fix breakage
Sponsored-by: author
-rw-r--r--Cargo.lock8
-rw-r--r--Cargo.toml2
-rw-r--r--src/generation.rs10
-rw-r--r--src/index.rs8
4 files changed, 14 insertions, 14 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 256d3d4..6f0bb9a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -758,9 +758,9 @@ checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219"
[[package]]
name = "libsqlite3-sys"
-version = "0.22.2"
+version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290b64917f8b0cb885d9de0f9959fe1f775d7fa12f1da2db9001c1c8ab60f89d"
+checksum = "abd5850c449b40bacb498b2bbdfaff648b1b055630073ba8db499caf2d0ea9f2"
dependencies = [
"pkg-config",
"vcpkg",
@@ -1376,9 +1376,9 @@ dependencies = [
[[package]]
name = "rusqlite"
-version = "0.25.3"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57adcf67c8faaf96f3248c2a7b419a0dbc52ebe36ba83dd57fe83827c1ea4eb3"
+checksum = "8a82b0b91fad72160c56bf8da7a549b25d7c31109f52cc1437eac4c0ad2550a7"
dependencies = [
"bitflags",
"fallible-iterator",
diff --git a/Cargo.toml b/Cargo.toml
index daedd4a..c2d53ec 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,7 +25,7 @@ pretty_env_logger = "0.4"
rand = "0.8"
reqwest = { version = "0.11", features = ["blocking", "json"]}
rpassword = "5"
-rusqlite = "0.25"
+rusqlite = "0.26"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.8"
diff --git a/src/generation.rs b/src/generation.rs
index de2ea10..33750ca 100644
--- a/src/generation.rs
+++ b/src/generation.rs
@@ -351,8 +351,8 @@ mod sql {
}
fn row_to_key_value(row: &Row) -> rusqlite::Result<(String, String)> {
- let key: String = row.get(row.column_index("key")?)?;
- let value: String = row.get(row.column_index("value")?)?;
+ let key: String = row.get("key")?;
+ let value: String = row.get("value")?;
Ok((key, value))
}
@@ -383,9 +383,9 @@ mod sql {
}
pub fn row_to_entry(row: &Row) -> rusqlite::Result<(FileId, String, String)> {
- let fileno: FileId = row.get(row.column_index("fileno")?)?;
- let json: String = row.get(row.column_index("json")?)?;
- let reason: String = row.get(row.column_index("reason")?)?;
+ let fileno: FileId = row.get("fileno")?;
+ let json: String = row.get("json")?;
+ let reason: String = row.get("reason")?;
Ok((fileno, json, reason))
}
diff --git a/src/index.rs b/src/index.rs
index 5d31068..d548396 100644
--- a/src/index.rs
+++ b/src/index.rs
@@ -262,20 +262,20 @@ mod sql {
}
fn row_to_meta(row: &Row) -> rusqlite::Result<ChunkMeta> {
- let hash: String = row.get(row.column_index("sha256")?)?;
+ let hash: String = row.get("sha256")?;
let sha256 = Checksum::sha256_from_str_unchecked(&hash);
- let generation: i32 = row.get(row.column_index("generation")?)?;
+ let generation: i32 = row.get("generation")?;
let meta = if generation == 0 {
ChunkMeta::new(&sha256)
} else {
- let ended: String = row.get(row.column_index("ended")?)?;
+ let ended: String = row.get("ended")?;
ChunkMeta::new_generation(&sha256, &ended)
};
Ok(meta)
}
fn row_to_id(row: &Row) -> rusqlite::Result<ChunkId> {
- let id: String = row.get(row.column_index("id")?)?;
+ let id: String = row.get("id")?;
Ok(ChunkId::recreate(&id))
}
}