Skip to content

Commit c03c664

Browse files
authored
Merge pull request #342 from meilisearch/bump-dependencies
Bump Dependencies & Make Clippy happy
2 parents 5a10a00 + b823612 commit c03c664

File tree

14 files changed

+38
-30
lines changed

14 files changed

+38
-30
lines changed

heed-types/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ edition = "2021"
1212
bincode = { version = "1.3.3", optional = true }
1313
byteorder = "1.5.0"
1414
heed-traits = { version = "0.20.0", path = "../heed-traits" }
15-
serde = { version = "1.0.218", optional = true }
16-
serde_json = { version = "1.0.140", optional = true }
15+
serde = { version = "1.0.223", optional = true }
16+
serde_json = { version = "1.0.145", optional = true }
1717
rmp-serde = { version = "1.3.0", optional = true }
1818

1919
[features]

heed-types/src/integer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct U8;
1111
impl BytesEncode<'_> for U8 {
1212
type EItem = u8;
1313

14-
fn bytes_encode(item: &Self::EItem) -> Result<Cow<[u8]>, BoxedError> {
14+
fn bytes_encode(item: &Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError> {
1515
Ok(Cow::from([*item].to_vec()))
1616
}
1717
}
@@ -30,7 +30,7 @@ pub struct I8;
3030
impl BytesEncode<'_> for I8 {
3131
type EItem = i8;
3232

33-
fn bytes_encode(item: &Self::EItem) -> Result<Cow<[u8]>, BoxedError> {
33+
fn bytes_encode(item: &Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError> {
3434
Ok(Cow::from([*item as u8].to_vec()))
3535
}
3636
}
@@ -54,7 +54,7 @@ macro_rules! define_type {
5454
impl<O: ByteOrder> BytesEncode<'_> for $name<O> {
5555
type EItem = $native;
5656

57-
fn bytes_encode(item: &Self::EItem) -> Result<Cow<[u8]>, BoxedError> {
57+
fn bytes_encode(item: &Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError> {
5858
let mut buf = vec![0; size_of::<Self::EItem>()];
5959
O::$write_method(&mut buf, *item);
6060
Ok(Cow::from(buf))

heed-types/src/serde_json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ where
1414
{
1515
type EItem = T;
1616

17-
fn bytes_encode(item: &Self::EItem) -> Result<Cow<[u8]>, BoxedError> {
17+
fn bytes_encode(item: &Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError> {
1818
serde_json::to_vec(item).map(Cow::Owned).map_err(Into::into)
1919
}
2020
}

heed-types/src/serde_rmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ where
1414
{
1515
type EItem = T;
1616

17-
fn bytes_encode(item: &Self::EItem) -> Result<Cow<[u8]>, BoxedError> {
17+
fn bytes_encode(item: &Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError> {
1818
rmp_serde::to_vec(item).map(Cow::Owned).map_err(Into::into)
1919
}
2020
}

heed-types/src/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub enum Str {}
99
impl BytesEncode<'_> for Str {
1010
type EItem = str;
1111

12-
fn bytes_encode(item: &Self::EItem) -> Result<Cow<[u8]>, BoxedError> {
12+
fn bytes_encode(item: &Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError> {
1313
Ok(Cow::Borrowed(item.as_bytes()))
1414
}
1515
}

heed-types/src/unit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub enum Unit {}
99
impl BytesEncode<'_> for Unit {
1010
type EItem = ();
1111

12-
fn bytes_encode(_item: &Self::EItem) -> Result<Cow<[u8]>, BoxedError> {
12+
fn bytes_encode(_item: &Self::EItem) -> Result<Cow<'_, [u8]>, BoxedError> {
1313
Ok(Cow::Borrowed(&[]))
1414
}
1515
}

heed/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ readme = "../README.md"
1111
edition = "2021"
1212

1313
[dependencies]
14-
bitflags = { version = "2.9.0", features = ["serde"] }
14+
bitflags = { version = "2.9.4", features = ["serde"] }
1515
byteorder = { version = "1.5.0", default-features = false }
1616
heed-traits = { version = "0.20.0", path = "../heed-traits" }
1717
heed-types = { version = "0.21.0", default-features = false, path = "../heed-types" }
18-
libc = "0.2.170"
18+
libc = "0.2.175"
1919
lmdb-master-sys = { version = "0.2.5", path = "../lmdb-master-sys" }
20-
once_cell = "1.20.3"
20+
once_cell = "1.21.3"
2121
page_size = "0.6.0"
22-
serde = { version = "1.0.218", features = ["derive"], optional = true }
22+
serde = { version = "1.0.223", features = ["derive"], optional = true }
2323
synchronoise = "1.0.1"
2424

2525
[dev-dependencies]
26-
memchr = "2.7.4"
27-
serde = { version = "1.0.218", features = ["derive"] }
28-
tempfile = "3.18.0"
26+
memchr = "2.7.5"
27+
serde = { version = "1.0.223", features = ["derive"] }
28+
tempfile = "3.22.0"
2929

3030
[target.'cfg(windows)'.dependencies]
31-
url = "2.5.4"
31+
url = "2.5.7"
3232

3333
[features]
3434
# The `serde` feature makes some types serializable,

heed/src/envs/encrypted_env.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ impl<T> EncryptedEnv<T> {
103103
}
104104

105105
/// Options and flags which can be used to configure how a [`Database`] is opened.
106-
pub fn database_options(&self) -> EncryptedDatabaseOpenOptions<T, Unspecified, Unspecified> {
106+
pub fn database_options(
107+
&self,
108+
) -> EncryptedDatabaseOpenOptions<'_, '_, T, Unspecified, Unspecified> {
107109
EncryptedDatabaseOpenOptions::new(self)
108110
}
109111

@@ -174,7 +176,7 @@ impl<T> EncryptedEnv<T> {
174176
/// If another write transaction is initiated, while another write transaction exists
175177
/// the thread initiating the new one will wait on a mutex upon completion of the previous
176178
/// transaction.
177-
pub fn write_txn(&self) -> Result<RwTxn> {
179+
pub fn write_txn(&self) -> Result<RwTxn<'_>> {
178180
self.inner.write_txn()
179181
}
180182

@@ -215,7 +217,7 @@ impl<T> EncryptedEnv<T> {
215217
/// map must be resized
216218
/// * [`crate::MdbError::ReadersFull`]: a read-only transaction was requested, and the reader lock table is
217219
/// full
218-
pub fn read_txn(&self) -> Result<RoTxn<T>> {
220+
pub fn read_txn(&self) -> Result<RoTxn<'_, T>> {
219221
self.inner.read_txn()
220222
}
221223

heed/src/envs/env.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<T> Env<T> {
195195
}
196196

197197
/// Options and flags which can be used to configure how a [`Database`] is opened.
198-
pub fn database_options(&self) -> DatabaseOpenOptions<T, Unspecified, Unspecified> {
198+
pub fn database_options(&self) -> DatabaseOpenOptions<'_, '_, T, Unspecified, Unspecified> {
199199
DatabaseOpenOptions::new(self)
200200
}
201201

@@ -331,7 +331,7 @@ impl<T> Env<T> {
331331
/// If another write transaction is initiated, while another write transaction exists
332332
/// the thread initiating the new one will wait on a mutex upon completion of the previous
333333
/// transaction.
334-
pub fn write_txn(&self) -> Result<RwTxn> {
334+
pub fn write_txn(&self) -> Result<RwTxn<'_>> {
335335
RwTxn::new(self)
336336
}
337337

@@ -372,7 +372,7 @@ impl<T> Env<T> {
372372
/// map must be resized
373373
/// * [`crate::MdbError::ReadersFull`]: a read-only transaction was requested, and the reader lock table is
374374
/// full
375-
pub fn read_txn(&self) -> Result<RoTxn<T>> {
375+
pub fn read_txn(&self) -> Result<RoTxn<'_, T>> {
376376
RoTxn::new(self)
377377
}
378378

@@ -594,7 +594,7 @@ impl<T> Env<T> {
594594
/// it is okay to call `mdb_env_set_mapsize` for an open environment as long as no transactions are active,
595595
/// but the library does not check for this condition, so the caller must ensure it explicitly.
596596
pub unsafe fn resize(&self, new_size: usize) -> Result<()> {
597-
if new_size % page_size::get() != 0 {
597+
if !new_size.is_multiple_of(page_size::get()) {
598598
let msg = format!(
599599
"map size ({}) must be a multiple of the system page size ({})",
600600
new_size,

heed/src/envs/env_open_options.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
use std::ffi::CString;
2-
#[cfg(windows)]
3-
use std::ffi::OsStr;
42
use std::io::ErrorKind::NotFound;
53
use std::marker::PhantomData;
64
#[cfg(unix)]

0 commit comments

Comments
 (0)