Skip to content

Commit

Permalink
chore: remove seemingly superflous doc_cfg parsing feature attribute,…
Browse files Browse the repository at this point in the history
… make clippy happy
  • Loading branch information
KonradHoeffner committed Oct 3, 2024
1 parent 7c3a375 commit df5abc5
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/containers/rdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ impl fmt::Debug for Term {

/// RDF Literals always have a lexical 'form' as per
/// [RDF 1.1 Concepts And Abstract Syntax](https://www.w3.org/TR/rdf11-concepts/#dfn-literal).
///
/// They can optionally contain a datatype describing how the literal form maps to a literal value
/// (The default type is: [xs:string](http://www.w3.org/2001/XMLSchema#string), but we do not store
/// this).
///
/// If the datatype is [rdf:langString](http://www.w3.org/1999/02/22-rdf-syntax-ns#langString),
/// we can optionally supply a language tag ([BCP47](https://tools.ietf.org/html/bcp47)) such as
/// `"nl"` or `"fr"`.
Expand Down
3 changes: 1 addition & 2 deletions src/containers/sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ impl Sequence {
// read body data
// read all but the last entry, since the last one is byte aligned
let total_bits = bits_per_entry * entries;
let full_byte_amount =
(((total_bits + USIZE_BITS - 1) / USIZE_BITS).saturating_sub(1)) * size_of::<usize>();
let full_byte_amount = (total_bits.div_ceil(USIZE_BITS).saturating_sub(1)) * size_of::<usize>();
let mut full_words = vec![0_u8; full_byte_amount];
reader.read_exact(&mut full_words)?;
let mut data: Vec<usize> = Vec::with_capacity(full_byte_amount / 8 + 2);
Expand Down
2 changes: 1 addition & 1 deletion src/hdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl Hdt {
/// ```
pub fn triples_with_pattern<'a>(
&'a self, sp: Option<&'a str>, pp: Option<&'a str>, op: Option<&'a str>,
) -> Box<dyn Iterator<Item = StringTriple> + '_> {
) -> Box<dyn Iterator<Item = StringTriple> + 'a> {
let xso: Option<(Arc<str>, usize)> =
sp.map(|s| (Arc::from(s), self.dict.string_to_id(s, &IdKind::Subject)));
let xpo: Option<(Arc<str>, usize)> =
Expand Down
5 changes: 4 additions & 1 deletion src/hdt_graph/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ impl HdtTerm {
}

impl Term for HdtTerm {
type BorrowTerm<'x> = &'x Self where Self: 'x;
type BorrowTerm<'x>
= &'x Self
where
Self: 'x;

fn kind(&self) -> TermKind {
match self {
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ use dict_sect_pfc::DictSectPFC;
use four_sect_dict::FourSectDict;
pub use four_sect_dict::IdKind;
#[cfg(feature = "sophia")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
pub use hdt_graph::HdtGraph;

#[cfg(test)]
Expand Down
1 change: 1 addition & 0 deletions src/triples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ impl<'a> IntoIterator for &'a TriplesBitmap {
}

/// Subject, predicate or object ID, starting at 1.
///
/// Subjects and predicate share IDs, starting at 1, for common values.
/// A value of 0 indicates either not found (as a return value) or all of them (in a triple pattern).
/// In the official documentation, u32 is used, however here, usize is used.
Expand Down

0 comments on commit df5abc5

Please sign in to comment.