Closed SimonBin closed 1 year ago
Thanks for reporting this.
However, I can't reproduce this bug with the latest version of the code. Could you update your repo (or use the brand new "0.8.0-alpha.0" on crates.io) and test again?
still happens:
test.nt
<urn:x:s> <urn:x:p> "" .
[dependencies]
sophia = { version = "0.8.0-alpha.0" }
fn main() {
let reader = BufReader::new(File::open("test.nt").unwrap());
let graph: LightGraph = nt::parse_bufread(reader).collect_triples().unwrap();
let mut nt_stringifier = NtSerializer::new_stringifier();
let ser = nt_stringifier.serialize_graph(&graph).unwrap().as_str();
println!("{}", ser);
}
the problem seems to be here: https://github.com/pchampin/mownstr/blob/v0.2.0/src/lib.rs#L146
let addr = NonNull::from(&other.as_bytes()[0]);
It was indeed a stupid bug in mownstr
causing this problem.
It was fixed in mownstr
0.2.1, and I upgraded the dependency in sophia
. Thanks for spotting it.
At the moment, you can fix your issue by using the following dependency:
sophia = { version = "0.8.0-alpha.0", git = "https://github.com/pchampin/sophia_rs" }
Shortly, I will release a new version of sophia
on crates.io that will integrate this change. But I'm reluctant to publish a new release for such a small change -- unless it is blocking for you. Just let me know.
no worries glad you could reproduce the issue
stacktrace
``` panicked at 'index out of bounds: the len is 0 but the index is 0', cargo/git/checkouts/mownstr-b4cf7b39965722e5/c88467d/src/lib.rs:146:35 stack backtrace: 0: rust_begin_unwind at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/panicking.rs:575:5 1: core::panicking::panic_fmt at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/core/src/panicking.rs:64:14 2: core::panicking::panic_bounds_check at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/core/src/panicking.rs:148:5 3: