Skip to content

Commit cb1e8ad

Browse files
committed
license fixes, clippy fixes
1 parent 47d3424 commit cb1e8ad

11 files changed

Lines changed: 29 additions & 19 deletions

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Copyright (c) 2024-2025, Decisym, LLC
1+
# Copyright (c) 2025, Decisym, LLC
2+
# Licensed under the BSD 3-Clause License (see LICENSE file in the project root).
23

34
lint:
45
cargo install cargo-machete

src/bitmap_triples.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Copyright (c) 2024-2025, Decisym, LLC
1+
// Copyright (c) 2025, Decisym, LLC
2+
// Licensed under the BSD 3-Clause License (see LICENSE file in the project root).
23

34
use crate::{
45
common::{byte_align_bitmap, save_u32_vec},

src/builder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Copyright (c) 2024-2025, Decisym, LLC
1+
// Copyright (c) 2025, Decisym, LLC
2+
// Licensed under the BSD 3-Clause License (see LICENSE file in the project root).
23

34
use super::{bitmap_triples::BitmapTriplesBuilder, dictionary::FourSectDictBuilder};
45
use crate::{rdf_reader::convert_to_nt, vocab::*};

src/common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Copyright (c) 2024-2025, Decisym, LLC
1+
// Copyright (c) 2025, Decisym, LLC
2+
// Licensed under the BSD 3-Clause License (see LICENSE file in the project root).
23

34
use std::{
45
error::Error,

src/dictionary.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Copyright (c) 2024-2025, Decisym, LLC
1+
// Copyright (c) 2025, Decisym, LLC
2+
// Licensed under the BSD 3-Clause License (see LICENSE file in the project root).
23

34
use hdt::{
45
containers::{self, ControlType, Sequence, vbyte::encode_vbyte},
@@ -267,7 +268,7 @@ pub fn compress(set: &BTreeSet<String>, block_size: usize) -> Result<DictSectPFC
267268
.unwrap_or(term.len());
268269

269270
compressed_terms.extend_from_slice(&encode_vbyte(common_prefix_len));
270-
compressed_terms.extend_from_slice(term[byte_offset..].as_bytes());
271+
compressed_terms.extend_from_slice(&term.as_bytes()[byte_offset..]);
271272
}
272273

273274
compressed_terms.push(0); // Null separator

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Copyright (c) 2024-2025, Decisym, LLC
1+
// Copyright (c) 2025, Decisym, LLC
2+
// Licensed under the BSD 3-Clause License (see LICENSE file in the project root).
23

34
pub mod bitmap_triples;
45
pub mod builder;

src/log_sequence.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Copyright (c) 2024-2025, Decisym, LLC
1+
// Copyright (c) 2025, Decisym, LLC
2+
// Licensed under the BSD 3-Clause License (see LICENSE file in the project root).
23

34
use crate::common::save_u32_vec;
45
use hdt::containers::vbyte::encode_vbyte;
@@ -39,8 +40,15 @@ impl LogSequence2 {
3940
.zip(term.chars())
4041
.take_while(|(a, b)| a == b)
4142
.count();
43+
44+
let byte_offset = term
45+
.char_indices()
46+
.nth(common_prefix_len)
47+
.map(|(i, _)| i)
48+
.unwrap_or(term.len());
49+
4250
compressed_terms.extend_from_slice(&encode_vbyte(common_prefix_len));
43-
compressed_terms.extend_from_slice(term[common_prefix_len..].as_bytes());
51+
compressed_terms.extend_from_slice(&term.as_bytes()[byte_offset..]);
4452
};
4553

4654
compressed_terms.push(0); // Null separator

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Copyright (c) 2024-2025, Decisym, LLC
1+
// Copyright (c) 2025, Decisym, LLC
2+
// Licensed under the BSD 3-Clause License (see LICENSE file in the project root).
23

34
//! # rdf2hdt Converter
45
//!

src/mod.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/rdf_reader.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Copyright (c) 2024-2025, Decisym, LLC
1+
// Copyright (c) 2025, Decisym, LLC
2+
// Licensed under the BSD 3-Clause License (see LICENSE file in the project root).
23

34
use log::{debug, error, warn};
45
use oxrdfio::RdfSerializer;

0 commit comments

Comments
 (0)