Skip to content

Commit

Permalink
pleasing fmt and clippy 1.72.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pchampin committed Aug 31, 2023
1 parent e888cb4 commit 45a8b57
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api/src/dataset/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ macro_rules! test_dataset_impl {

let quads = d.quads();
let hint = quads.size_hint();
for iter in vec![quads, d.quads_matching(Any, Any, Any, Any)] {
for iter in [quads, d.quads_matching(Any, Any, Any, Any)] {
let v: Vec<_> = iter.map(Result::unwrap).collect();
assert_eq!(v.len(), d.quads().count());
assert_consistent_hint(v.len(), hint);
Expand Down
2 changes: 1 addition & 1 deletion api/src/graph/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ macro_rules! test_graph_impl {
fn triples() -> Result<(), Box<dyn std::error::Error>> {
let g: $graph_impl = $graph_collector(some_triples()).unwrap();

for iter in vec![g.triples(), g.triples_matching(Any, Any, Any)] {
for iter in [g.triples(), g.triples_matching(Any, Any, Any)] {
let hint = iter.size_hint();
let v: Vec<_> = iter.map(Result::unwrap).collect();
assert_eq!(v.len(), SOME_TRIPLES_COUNT);
Expand Down
2 changes: 1 addition & 1 deletion api/src/term/matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub struct MatcherRef<'a, T: ?Sized>(&'a T);

impl<'a, T> Clone for MatcherRef<'a, T> {
fn clone(&self) -> Self {
MatcherRef(self.0)
*self
}
}
impl<'a, T> Copy for MatcherRef<'a, T> {}
Expand Down
4 changes: 2 additions & 2 deletions api/src/term/var_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ lazy_static! {
/// # Rule
///
/// `VARNAME ::= ( PN_CHARS_U | [0-9] ) ( PN_CHARS_U | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040] )*`
static ref VARNAME: Regex = Regex::new(r#"(?x)
static ref VARNAME: Regex = Regex::new(r"(?x)
^
[_A-Za-z0-9\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\U{10000}-\U{EFFFF}]
[_A-Za-z0-9\u{B7}\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{300}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{203F}-\u{2040}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\U{10000}-\U{EFFFF}]*
$
"#).unwrap();
").unwrap();
}

wrap! { VarName borrowing str :
Expand Down
6 changes: 3 additions & 3 deletions inmem/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ impl<TI: TermIndex> Graph for GenericLightGraph<TI> {
{
if let Some(sc) = sm.constant() {
let Some(si) = self.terms.get_index(sc.borrow_term()) else {
return Box::new(empty())
return Box::new(empty());
};
let s = self.terms.get_term(si);
if let Some(pc) = pm.constant() {
let Some(pi) = self.terms.get_index(pc.borrow_term()) else {
return Box::new(empty())
return Box::new(empty());
};
let p = self.terms.get_term(pi);
if let Some(oc) = om.constant() {
let Some(oi) = self.terms.get_index(oc.borrow_term()) else {
return Box::new(empty())
return Box::new(empty());
};
let o = self.terms.get_term(oi);

Expand Down
2 changes: 1 addition & 1 deletion term/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mod test {
use super::*;

#[test]
#[allow(clippy::needless_borrow,unused_assignments)]
#[allow(clippy::needless_borrow, unused_assignments)]
fn arc_str_stash_iri() {
let mut stash = ArcStrStash::new();
assert_eq!(0, stash.len());
Expand Down
2 changes: 1 addition & 1 deletion turtle/src/serializer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Serializers for the Turtle-familt of RDF concrete syntaxes,
//! based on [`rio_turtle`].

pub(self) mod _pretty;
mod _pretty;
pub mod nq;
pub mod nt;
pub mod trig;
Expand Down
4 changes: 2 additions & 2 deletions turtle/src/serializer/_pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ impl<'a, W: Write> Prettifier<'a, W> {
if rdf::nil == iri {
return self.write_bytes(b"()");
}
let Some(iri) = Iri::new(iri.as_str()).ok() else {
return write!(self.write, "<{}>", iri.as_str())
let Some(iri) = Iri::new(iri.as_str()).ok() else {
return write!(self.write, "<{}>", iri.as_str());
};
match self
.config
Expand Down

0 comments on commit 45a8b57

Please sign in to comment.