From f46ab9bac09febc4f7b4eb272499d0522abaa60b Mon Sep 17 00:00:00 2001 From: Yoh Deadfall Date: Fri, 18 Apr 2025 22:28:07 +0300 Subject: [PATCH] Changed edition to 2024 --- Cargo.toml | 2 +- benches/ordpath.rs | 2 +- src/enc.rs | 4 +--- src/lib.rs | 6 +----- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6a44a73..80219aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "ordpath" version = "0.5.0" authors = ["Yoh Deadfall "] -edition = "2021" +edition = "2024" homepage = "https://github.com/yohdeadfall/ordpath/" repository = "https://github.com/yohdeadfall/ordpath/" description = "Implementation of the ORDPATH hierarchical labeling scheme" diff --git a/benches/ordpath.rs b/benches/ordpath.rs index f616869..3cdde4f 100644 --- a/benches/ordpath.rs +++ b/benches/ordpath.rs @@ -1,4 +1,4 @@ -use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use criterion::{Criterion, black_box, criterion_group, criterion_main}; use ordpath::{DefaultEncoding, OrdPathBuf}; fn comparison(c: &mut Criterion) { diff --git a/src/enc.rs b/src/enc.rs index 7943f92..becd885 100644 --- a/src/enc.rs +++ b/src/enc.rs @@ -291,9 +291,7 @@ impl> UserDefinedEncoding { impl> Encoding for UserDefinedEncoding { fn stage_by_prefix(&self, prefix: u8) -> Option<&Stage> { let index = self.stages_lookup[prefix as usize] as usize; - let stage = self.stages.as_ref().get(index); - - stage + self.stages.as_ref().get(index) } fn stage_by_value(&self, value: i64) -> Option<&Stage> { diff --git a/src/lib.rs b/src/lib.rs index 2a86bb3..80101b3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,11 +65,7 @@ pub(crate) struct Buf { impl Buf { const INLINE_SIZE_LEN: usize = { const fn max(lhs: usize, rhs: usize) -> usize { - if lhs > rhs { - lhs - } else { - rhs - } + if lhs > rhs { lhs } else { rhs } } const fn meta_size(data_len: usize) -> usize {