|
1 | 1 | //! Python bindings for hannoy. |
| 2 | +use std::path::PathBuf; |
| 3 | +use std::sync::LazyLock; |
| 4 | + |
2 | 5 | use heed::{RoTxn, RwTxn, WithoutTls}; |
3 | 6 | use once_cell::sync::OnceCell; |
4 | 7 | use parking_lot::{MappedMutexGuard, Mutex, MutexGuard}; |
5 | | -use pyo3::{ |
6 | | - exceptions::{PyIOError, PyRuntimeError}, |
7 | | - prelude::*, |
8 | | - types::PyType, |
9 | | -}; |
10 | | -use pyo3_stub_gen::{ |
11 | | - define_stub_info_gatherer, |
12 | | - derive::{gen_stub_pyclass, gen_stub_pyclass_enum, gen_stub_pymethods}, |
13 | | -}; |
14 | | -use std::{path::PathBuf, sync::LazyLock}; |
| 8 | +use pyo3::exceptions::{PyIOError, PyRuntimeError}; |
| 9 | +use pyo3::prelude::*; |
| 10 | +use pyo3::types::PyType; |
| 11 | +use pyo3_stub_gen::define_stub_info_gatherer; |
| 12 | +use pyo3_stub_gen::derive::{gen_stub_pyclass, gen_stub_pyclass_enum, gen_stub_pymethods}; |
15 | 13 |
|
16 | 14 | use crate::{distance, Database, ItemId, Reader, Writer}; |
17 | 15 | static DEFAULT_ENV_SIZE: usize = 1024 * 1024 * 1024; // 1GiB |
@@ -257,7 +255,8 @@ pub(super) struct PyWriter { |
257 | 255 |
|
258 | 256 | impl PyWriter { |
259 | 257 | fn build(&self) -> PyResult<()> { |
260 | | - use rand::{rngs::StdRng, SeedableRng}; |
| 258 | + use rand::rngs::StdRng; |
| 259 | + use rand::SeedableRng; |
261 | 260 |
|
262 | 261 | let mut rng = StdRng::seed_from_u64(42); |
263 | 262 | let mut wtxn = get_rw_txn()?; |
|
0 commit comments