Skip to content

Commit 9c76a72

Browse files
Update arrow requirement from 31 to 32 (#116)
* Update arrow requirement from 31 to 32 Updates the requirements on [arrow](https://github.com/apache/arrow-rs) to permit the latest version. - [Release notes](https://github.com/apache/arrow-rs/releases) - [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/apache/arrow-rs/commits) --- updated-dependencies: - dependency-name: arrow dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * fix clippy Change-Id: I6ebc6d404c353d72d637f53b082ce6c18544023c * fix clippy error Change-Id: I73b224022bf4a1431ebea2cdb8f6a0bd99b5657d * fix clippy error Change-Id: I7b75656301e43974d405e032050374b875ba0c28 * use master Change-Id: Ief0eef1c0815d0b94e1d1504e7aba1c5282033a3 * update tarpaulin Change-Id: Ibb6a593ee6080b7479a333ec40442c22f0d7086a * use master Change-Id: Ie26c48d7b1f3dbad09ac4a4d00840e3c05615af1 * update Change-Id: Ia9034a0e3cb30b35a96ba24b15d8e5dc33613717 * use 0.16 Change-Id: I718dc77e78c6f2175875166b328f03262d577932 * update version Change-Id: I0d1cd6482bb7fa63575b34d796580bc5203e159b --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: wangfenjin <[email protected]>
1 parent 5f14a40 commit 9c76a72

File tree

17 files changed

+59
-62
lines changed

17 files changed

+59
-62
lines changed

.github/workflows/rust.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
# Intentionally omit time feature until we're on time 0.3, at which
6666
# point it should be added to `bundled-full`.
6767
args: '--features "buildtime_bindgen" --features "modern-full" --avoid-cfg-tarpaulin' # TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320)
68+
version: 0.22.0
6869
env:
6970
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
7071
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ memchr = "2.3"
4747
uuid = { version = "1.0", optional = true }
4848
smallvec = "1.6.1"
4949
cast = { version = "0.3", features = ["std"] }
50-
arrow = { version = "31", default-features = false, features = ["prettyprint", "ffi"] }
50+
arrow = { version = "32", default-features = false, features = ["prettyprint", "ffi"] }
5151
rust_decimal = "1.14"
5252
strum = { version = "0.24", features = ["derive"] }
5353
r2d2 = { version = "0.8.9", optional = true }

libduckdb-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ cc = { version = "1.0", features = ["parallel"], optional = true }
2828
vcpkg = { version = "0.2", optional = true }
2929

3030
[dev-dependencies]
31-
arrow = { version = "31", default-features = false, features = ["ffi"] }
31+
arrow = { version = "32", default-features = false, features = ["ffi"] }

libduckdb-sys/build.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ mod build_bundled {
5151
#[cfg(feature = "buildtime_bindgen")]
5252
{
5353
use super::{bindings, HeaderLocation};
54-
let header = HeaderLocation::FromPath(format!("{}/duckdb.h", lib_name));
54+
let header = HeaderLocation::FromPath(format!("{lib_name}/duckdb.h"));
5555
bindings::write_to_out_dir(header, out_path);
5656
}
5757
#[cfg(not(feature = "buildtime_bindgen"))]
@@ -60,10 +60,10 @@ mod build_bundled {
6060
fs::copy(format!("{}/bindgen_bundled_version.rs", lib_name), out_path)
6161
.expect("Could not copy bindings to output directory");
6262
}
63-
println!("cargo:rerun-if-changed={}/duckdb.hpp", lib_name);
64-
println!("cargo:rerun-if-changed={}/duckdb.cpp", lib_name);
63+
println!("cargo:rerun-if-changed={lib_name}/duckdb.hpp");
64+
println!("cargo:rerun-if-changed={lib_name}/duckdb.cpp");
6565
let mut cfg = cc::Build::new();
66-
cfg.file(format!("{}/duckdb.cpp", lib_name))
66+
cfg.file(format!("{lib_name}/duckdb.cpp"))
6767
.cpp(true)
6868
.flag_if_supported("-std=c++11")
6969
.flag_if_supported("-stdlib=libc++")
@@ -77,7 +77,7 @@ mod build_bundled {
7777

7878
cfg.compile(lib_name);
7979

80-
println!("cargo:lib_dir={}", out_dir);
80+
println!("cargo:lib_dir={out_dir}");
8181
}
8282
}
8383

@@ -100,7 +100,7 @@ impl From<HeaderLocation> for String {
100100
match header {
101101
HeaderLocation::FromEnvironment => {
102102
let prefix = env_prefix();
103-
let mut header = env::var(format!("{}_INCLUDE_DIR", prefix))
103+
let mut header = env::var(format!("{prefix}_INCLUDE_DIR"))
104104
.unwrap_or_else(|_| env::var(format!("{}_LIB_DIR", env_prefix())).unwrap());
105105
header.push_str("/duckdb.h");
106106
header
@@ -162,23 +162,23 @@ mod build_linked {
162162
// `links=` value in our Cargo.toml) to get this value. This might be
163163
// useful if you need to ensure whatever crypto library sqlcipher relies
164164
// on is available, for example.
165-
println!("cargo:link-target={}", link_lib);
165+
println!("cargo:link-target={link_lib}");
166166

167167
if win_target() && cfg!(feature = "winduckdb") {
168-
println!("cargo:rustc-link-lib=dylib={}", link_lib);
168+
println!("cargo:rustc-link-lib=dylib={link_lib}");
169169
return HeaderLocation::Wrapper;
170170
}
171171

172172
// Allow users to specify where to find DuckDB.
173173
if let Ok(dir) = env::var(format!("{}_LIB_DIR", env_prefix())) {
174-
println!("cargo:rustc-env=LD_LIBRARY_PATH={}", dir);
174+
println!("cargo:rustc-env=LD_LIBRARY_PATH={dir}");
175175
// Try to use pkg-config to determine link commands
176176
let pkgconfig_path = Path::new(&dir).join("pkgconfig");
177177
env::set_var("PKG_CONFIG_PATH", pkgconfig_path);
178178
if pkg_config::Config::new().probe(link_lib).is_err() {
179179
// Otherwise just emit the bare minimum link commands.
180180
println!("cargo:rustc-link-lib={}={}", find_link_mode(), link_lib);
181-
println!("cargo:rustc-link-search={}", dir);
181+
println!("cargo:rustc-link-search={dir}");
182182
}
183183
return HeaderLocation::FromEnvironment;
184184
}
@@ -241,7 +241,7 @@ mod bindings {
241241
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
242242
.rustfmt_bindings(true)
243243
.generate()
244-
.unwrap_or_else(|_| panic!("could not run bindgen on header {}", header))
244+
.unwrap_or_else(|_| panic!("could not run bindgen on header {header}"))
245245
.write(Box::new(&mut output))
246246
.expect("could not write output of bindgen");
247247
let output = String::from_utf8(output).expect("bindgen output was not UTF-8?!");
@@ -250,9 +250,9 @@ mod bindings {
250250
.truncate(true)
251251
.create(true)
252252
.open(out_path)
253-
.unwrap_or_else(|_| panic!("Could not write to {:?}", out_path));
253+
.unwrap_or_else(|_| panic!("Could not write to {out_path:?}"));
254254

255255
file.write_all(output.as_bytes())
256-
.unwrap_or_else(|_| panic!("Could not write to {:?}", out_path));
256+
.unwrap_or_else(|_| panic!("Could not write to {out_path:?}"));
257257
}
258258
}

libduckdb-sys/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ mod tests {
4242
for row_idx in 0..duckdb_row_count(&mut result) {
4343
for col_idx in 0..duckdb_column_count(&mut result) {
4444
let val = duckdb_value_int32(&mut result, col_idx, row_idx);
45-
print!("{} ", val);
45+
print!("{val} ");
4646
}
4747
println!();
4848
}

src/column.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ mod test {
184184
assert_eq!(ty, Type::Int);
185185
}
186186
e => {
187-
panic!("Unexpected error type: {:?}", e);
187+
panic!("Unexpected error type: {e:?}");
188188
}
189189
}
190190
match row.get::<_, String>("y").unwrap_err() {
@@ -194,7 +194,7 @@ mod test {
194194
assert_eq!(ty, Type::Null);
195195
}
196196
e => {
197-
panic!("Unexpected error type: {:?}", e);
197+
panic!("Unexpected error type: {e:?}");
198198
}
199199
}
200200
Ok(())

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl Config {
117117
if state != ffi::DuckDBSuccess {
118118
return Err(Error::DuckDBFailure(
119119
ffi::Error::new(state),
120-
Some(format!("set {}:{} error", key, value)),
120+
Some(format!("set {key}:{value} error")),
121121
));
122122
}
123123
Ok(())

src/error.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,40 +145,38 @@ impl fmt::Display for Error {
145145
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
146146
match *self {
147147
Error::DuckDBFailure(ref err, None) => err.fmt(f),
148-
Error::DuckDBFailure(_, Some(ref s)) => write!(f, "{}", s),
148+
Error::DuckDBFailure(_, Some(ref s)) => write!(f, "{s}"),
149149
Error::FromSqlConversionFailure(i, ref t, ref err) => {
150150
if i != UNKNOWN_COLUMN {
151-
write!(f, "Conversion error from type {} at index: {}, {}", t, i, err)
151+
write!(f, "Conversion error from type {t} at index: {i}, {err}")
152152
} else {
153153
err.fmt(f)
154154
}
155155
}
156156
Error::IntegralValueOutOfRange(col, val) => {
157157
if col != UNKNOWN_COLUMN {
158-
write!(f, "Integer {} out of range at index {}", val, col)
158+
write!(f, "Integer {val} out of range at index {col}")
159159
} else {
160-
write!(f, "Integer {} out of range", val)
160+
write!(f, "Integer {val} out of range")
161161
}
162162
}
163163
Error::Utf8Error(ref err) => err.fmt(f),
164164
Error::NulError(ref err) => err.fmt(f),
165-
Error::InvalidParameterName(ref name) => write!(f, "Invalid parameter name: {}", name),
165+
Error::InvalidParameterName(ref name) => write!(f, "Invalid parameter name: {name}"),
166166
Error::InvalidPath(ref p) => write!(f, "Invalid path: {}", p.to_string_lossy()),
167167
Error::ExecuteReturnedResults => {
168168
write!(f, "Execute returned results - did you mean to call query?")
169169
}
170170
Error::QueryReturnedNoRows => write!(f, "Query returned no rows"),
171-
Error::InvalidColumnIndex(i) => write!(f, "Invalid column index: {}", i),
172-
Error::InvalidColumnName(ref name) => write!(f, "Invalid column name: {}", name),
171+
Error::InvalidColumnIndex(i) => write!(f, "Invalid column index: {i}"),
172+
Error::InvalidColumnName(ref name) => write!(f, "Invalid column name: {name}"),
173173
Error::InvalidColumnType(i, ref name, ref t) => {
174-
write!(f, "Invalid column type {} at index: {}, name: {}", t, i, name)
174+
write!(f, "Invalid column type {t} at index: {i}, name: {name}")
175175
}
176-
Error::InvalidParameterCount(i1, n1) => write!(
177-
f,
178-
"Wrong number of parameters passed to query. Got {}, needed {}",
179-
i1, n1
180-
),
181-
Error::StatementChangedRows(i) => write!(f, "Query changed {} rows", i),
176+
Error::InvalidParameterCount(i1, n1) => {
177+
write!(f, "Wrong number of parameters passed to query. Got {i1}, needed {n1}")
178+
}
179+
Error::StatementChangedRows(i) => write!(f, "Query changed {i} rows"),
182180
Error::ToSqlConversionFailure(ref err) => err.fmt(f),
183181
Error::InvalidQuery => write!(f, "Query is not read-only"),
184182
Error::MultipleStatement => write!(f, "Multiple statements provided"),

src/inner_connection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ impl Drop for InnerConnection {
117117
use std::thread::panicking;
118118
if let Err(e) = self.close() {
119119
if panicking() {
120-
eprintln!("Error while closing DuckDB connection: {:?}", e);
120+
eprintln!("Error while closing DuckDB connection: {e:?}");
121121
} else {
122-
panic!("Error while closing DuckDB connection: {:?}", e);
122+
panic!("Error while closing DuckDB connection: {e:?}");
123123
}
124124
}
125125
}

src/lib.rs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl<'a> fmt::Display for DatabaseName<'a> {
187187
match *self {
188188
DatabaseName::Main => write!(f, "main"),
189189
DatabaseName::Temp => write!(f, "temp"),
190-
DatabaseName::Attached(s) => write!(f, "{}", s),
190+
DatabaseName::Attached(s) => write!(f, "{s}"),
191191
}
192192
}
193193
}
@@ -655,9 +655,7 @@ mod test {
655655
// assert_eq!(ErrorCode::CannotOpen, e.code);
656656
assert!(
657657
msg.contains(filename),
658-
"error message '{}' does not contain '{}'",
659-
msg,
660-
filename
658+
"error message '{msg}' does not contain '{filename}'"
661659
);
662660
} else {
663661
panic!("DuckDBFailure expected");
@@ -854,7 +852,7 @@ mod test {
854852
let result: Result<i64> = db.query_row("SELECT x FROM foo WHERE x > 5", [], |r| r.get(0));
855853
match result.unwrap_err() {
856854
Error::QueryReturnedNoRows => (),
857-
err => panic!("Unexpected error {}", err),
855+
err => panic!("Unexpected error {err}"),
858856
}
859857

860858
let bad_query_result = db.query_row("NOT A PROPER QUERY; test123", [], |_| Ok(()));
@@ -910,7 +908,7 @@ mod test {
910908
let query = "SELECT 12345";
911909
let stmt = db.prepare(query)?;
912910

913-
assert!(format!("{:?}", stmt).contains(query));
911+
assert!(format!("{stmt:?}").contains(query));
914912
Ok(())
915913
}
916914

@@ -927,7 +925,7 @@ mod test {
927925
// TODO(wangfenjin): Update errorcode
928926
assert_eq!(err.code, ErrorCode::Unknown);
929927
}
930-
err => panic!("Unexpected error {}", err),
928+
err => panic!("Unexpected error {err}"),
931929
}
932930
Ok(())
933931
}
@@ -975,7 +973,7 @@ mod test {
975973
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
976974
match *self {
977975
CustomError::SomeError => write!(f, "my custom error"),
978-
CustomError::Sqlite(ref se) => write!(f, "my custom error: {}", se),
976+
CustomError::Sqlite(ref se) => write!(f, "my custom error: {se}"),
979977
}
980978
}
981979
}
@@ -1037,14 +1035,14 @@ mod test {
10371035

10381036
match bad_type.unwrap_err() {
10391037
Error::InvalidColumnType(..) => (),
1040-
err => panic!("Unexpected error {}", err),
1038+
err => panic!("Unexpected error {err}"),
10411039
}
10421040

10431041
let bad_idx: Result<Vec<String>> = query.query_and_then([], |row| row.get(3))?.collect();
10441042

10451043
match bad_idx.unwrap_err() {
10461044
Error::InvalidColumnIndex(_) => (),
1047-
err => panic!("Unexpected error {}", err),
1045+
err => panic!("Unexpected error {err}"),
10481046
}
10491047
Ok(())
10501048
}
@@ -1089,7 +1087,7 @@ mod test {
10891087

10901088
match bad_type.unwrap_err() {
10911089
CustomError::Sqlite(Error::InvalidColumnType(..)) => (),
1092-
err => panic!("Unexpected error {}", err),
1090+
err => panic!("Unexpected error {err}"),
10931091
}
10941092

10951093
let bad_idx: CustomResult<Vec<String>> = query
@@ -1098,15 +1096,15 @@ mod test {
10981096

10991097
match bad_idx.unwrap_err() {
11001098
CustomError::Sqlite(Error::InvalidColumnIndex(_)) => (),
1101-
err => panic!("Unexpected error {}", err),
1099+
err => panic!("Unexpected error {err}"),
11021100
}
11031101

11041102
let non_sqlite_err: CustomResult<Vec<String>> =
11051103
query.query_and_then([], |_| Err(CustomError::SomeError))?.collect();
11061104

11071105
match non_sqlite_err.unwrap_err() {
11081106
CustomError::SomeError => (),
1109-
err => panic!("Unexpected error {}", err),
1107+
err => panic!("Unexpected error {err}"),
11101108
}
11111109
Ok(())
11121110
}
@@ -1143,23 +1141,23 @@ mod test {
11431141

11441142
match bad_type.unwrap_err() {
11451143
CustomError::Sqlite(Error::InvalidColumnType(..)) => (),
1146-
err => panic!("Unexpected error {}", err),
1144+
err => panic!("Unexpected error {err}"),
11471145
}
11481146

11491147
let bad_idx: CustomResult<String> =
11501148
db.query_row_and_then(query, [], |row| row.get(3).map_err(CustomError::Sqlite));
11511149

11521150
match bad_idx.unwrap_err() {
11531151
CustomError::Sqlite(Error::InvalidColumnIndex(_)) => (),
1154-
err => panic!("Unexpected error {}", err),
1152+
err => panic!("Unexpected error {err}"),
11551153
}
11561154

11571155
let non_sqlite_err: CustomResult<String> =
11581156
db.query_row_and_then(query, [], |_| Err(CustomError::SomeError));
11591157

11601158
match non_sqlite_err.unwrap_err() {
11611159
CustomError::SomeError => (),
1162-
err => panic!("Unexpected error {}", err),
1160+
err => panic!("Unexpected error {err}"),
11631161
}
11641162
Ok(())
11651163
}

0 commit comments

Comments
 (0)