I found code with implementation of b-tree in rust:
where is used uint
pub struct BTreeMap<K, V> {
root: Node<K, V>,
length: uint,
depth: uint,
b: uint,
}
I wanted to rewrite this implementation, copied this fragment and saw error
error[E0412]: cannot find type `uint` in this scope
--> src/bin/prepare-btree.rs:9:13
|
9 | length: uint,
| ^^^^ not found in this scope
I tried to add
use core::prelude::*;
and
use {core::primitive::uint};
but it did not helped.
All "imports" in my file are listed below:
use std::io::{BufRead, BufReader};
use std::fs::File;
use {core::iter::Map};
In original code that I can't find place where uint is imported.
Docs of uint:
https://doc.rust-lang.org/core/primitive.unit.html
Questions:
- how
use core::prelude::*;works and why in code from github linkuintis available? - how to fix
cannot find typeuintin this scopein my code?
This code is very old (2014) before the 1.0 release.
uintwas a thing back then. The current code is at https://github.com/rust-lang/rust/blob/3b1c8a94a4e8a6ba8bc7b39cc3580db9e5b72295/library/alloc/src/collections/btree/map.rs#L172: