dbase-rs
dbase-rs copied to clipboard
assertion error
hi, i'm trying to write a dbf file (from another dbf) and i keep failing with the following traceback:
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `7`,
right: `6`': /home/radek/.cargo/registry/src/github.com-1ecc6299db9ec823/dbase-0.3.0/src/writing.rs:365
0: <backtrace::capture::Backtrace as core::default::Default>::default
at /home/radek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.66/src/capture.rs:410:9
1: log_panics::Config::install_panic_hook::{{closure}}
at /home/radek/.cargo/registry/src/github.com-1ecc6299db9ec823/log-panics-2.1.0/src/lib.rs:115:29
2: std::panicking::rust_panic_with_hook
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:702:17
3: std::panicking::begin_panic_handler::{{closure}}
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:588:13
4: std::sys_common::backtrace::__rust_end_short_backtrace
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/sys_common/backtrace.rs:138:18
5: rust_begin_unwind
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
6: core::panicking::panic_fmt
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
7: core::panicking::assert_failed_inner
8: core::panicking::assert_failed
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:181:5
9: dbase::writing::FieldWriter<W>::write_next_field_value
at /home/radek/.cargo/registry/src/github.com-1ecc6299db9ec823/dbase-0.3.0/src/writing.rs:365:13
10: <dbase::reading::Record as dbase::writing::WritableRecord>::write_using
at /home/radek/.cargo/registry/src/github.com-1ecc6299db9ec823/dbase-0.3.0/src/writing.rs:306:13
11: dbase::writing::TableWriter<W>::write_record
at /home/radek/.cargo/registry/src/github.com-1ecc6299db9ec823/dbase-0.3.0/src/writing.rs:488:9
12: dbase::writing::TableWriter<W>::write_records
at /home/radek/.cargo/registry/src/github.com-1ecc6299db9ec823/dbase-0.3.0/src/writing.rs:544:13
13: mj191_tool::main
at src/main.rs:80:5
(...it goes on but that's not interesting, i guess)
the code is basically this:
let mut reader = dbase::Reader::from_path(db_fn).unwrap();
let mut recs = reader.read().unwrap();
let mut writer = dbase::TableWriterBuilder::from_reader(reader).build_with_file_dest("/tmp/test.dbf").unwrap();
writer.write_records(&recs).unwrap();
...what could be the cause?
thanks!