mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-30 16:19:35 +00:00
Fix build when bstr
is also imported.
Add type annotation to `vec` to avoid the following build error if you additionally import `bstr`: ``` ~/jj> cargo test Compiling jj-lib v0.8.0 (/home/aspotashev/jj/lib) warning: unused import: `bstr` --> lib/src/default_index_store.rs:30:5 | 30 | use bstr; | ^^^^ | = note: `#[warn(unused_imports)]` on by default error[E0282]: type annotations needed --> lib/src/default_index_store.rs:564:14 | 564 | .as_mut() | ^^^^^^ 565 | .write_u32::<LittleEndian>(parent_overflow.len() as u32) | --------- type must be known at this point | help: try using a fully qualified path to specify the expected types | 563 | <[u8] as AsMut<T>>::as_mut(&mut buf[parent_overflow_offset..parent_overflow_offset + 4]) | +++++++++++++++++++++++++++++++ ~ For more information about this error, try `rustc --explain E0282`. warning: `jj-lib` (lib) generated 1 warning error: could not compile `jj-lib` (lib) due to previous error; 1 warning emitted ``` Reason to support `bstr` being imported: in a Bazel environment where crates are imported with certain features enabled, jj-lib may pull in bstr as part of the following dependency chain: jj-lib -> insta -> similar -> bstr.
This commit is contained in:
parent
873634a80e
commit
2d81cf9156
1 changed files with 1 additions and 2 deletions
|
@ -560,8 +560,7 @@ impl MutableIndexImpl {
|
||||||
buf.write_u32::<LittleEndian>(pos.0).unwrap();
|
buf.write_u32::<LittleEndian>(pos.0).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
buf[parent_overflow_offset..parent_overflow_offset + 4]
|
(&mut buf[parent_overflow_offset..parent_overflow_offset + 4])
|
||||||
.as_mut()
|
|
||||||
.write_u32::<LittleEndian>(parent_overflow.len() as u32)
|
.write_u32::<LittleEndian>(parent_overflow.len() as u32)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
for parent_pos in parent_overflow {
|
for parent_pos in parent_overflow {
|
||||||
|
|
Loading…
Reference in a new issue