Makes doc tests fail on warning

pull/46/head
Tpt 4 years ago
parent 19d9ddb56e
commit 562cda7d97
  1. 1
      lib/src/lib.rs
  2. 6
      lib/src/sparql/model.rs
  3. 9
      lib/src/store/memory.rs

@ -102,6 +102,7 @@
clippy::wildcard_dependencies,
clippy::wrong_pub_self_convention,
)]
#![doc(test(attr(deny(warnings))))]
mod error;
pub mod model;

@ -39,7 +39,7 @@ impl QueryResult {
/// ```
/// use oxigraph::model::*;
/// use oxigraph::{MemoryStore, Result};
/// use oxigraph::sparql::{QueryOptions, QueryResult, QueryResultSyntax};
/// use oxigraph::sparql::{QueryOptions, QueryResultSyntax};
///
/// let store = MemoryStore::new();
/// let ex = NamedNode::new("http://example.com")?;
@ -64,13 +64,13 @@ impl QueryResult {
/// ```
/// use oxigraph::model::*;
/// use oxigraph::{MemoryStore, Result, GraphSyntax};
/// use oxigraph::sparql::{QueryOptions, QueryResult, QueryResultSyntax};
/// use oxigraph::sparql::QueryOptions;
/// use std::io::Cursor;
///
/// let graph = "<http://example.com> <http://example.com> <http://example.com> .\n".as_bytes();
///
/// let store = MemoryStore::new();
/// store.load_graph(Cursor::new(graph), GraphSyntax::NTriples, &GraphName::DefaultGraph, None);
/// store.load_graph(Cursor::new(graph), GraphSyntax::NTriples, &GraphName::DefaultGraph, None)?;
///
/// let mut results = Vec::new();
/// store.query("CONSTRUCT WHERE { ?s ?p ?o }", QueryOptions::default())?.write_graph(&mut results, GraphSyntax::NTriples)?;

@ -226,7 +226,7 @@ impl MemoryStore {
/// store.transaction(|transaction| {
/// transaction.insert(quad.clone());
/// Ok(())
/// });
/// })?;
///
/// // quad filter
/// assert!(store.contains(&quad));
@ -334,7 +334,7 @@ impl MemoryStore {
///
/// Usage example:
/// ```
/// use oxigraph::model::*;
/// use oxigraph::model::GraphName;
/// use oxigraph::{MemoryStore, Result, GraphSyntax};
///
/// let file = "<http://example.com> <http://example.com> <http://example.com> .\n".as_bytes();
@ -365,7 +365,6 @@ impl MemoryStore {
///
/// Usage example:
/// ```
/// use oxigraph::model::*;
/// use oxigraph::{MemoryStore, Result, DatasetSyntax};
///
/// let file = "<http://example.com> <http://example.com> <http://example.com> <http://example.com> .\n".as_bytes();
@ -970,7 +969,7 @@ impl<'a> MemoryTransaction<'a> {
/// // insertion
/// let file = b"<http://example.com> <http://example.com> <http://example.com> .";
/// store.transaction(|transaction| {
/// store.load_graph(file.as_ref(), GraphSyntax::NTriples, &GraphName::DefaultGraph, None)
/// transaction.load_graph(file.as_ref(), GraphSyntax::NTriples, &GraphName::DefaultGraph, None)
/// })?;
///
/// // quad filter
@ -1000,7 +999,7 @@ impl<'a> MemoryTransaction<'a> {
///
/// // insertion
/// let file = b"<http://example.com> <http://example.com> <http://example.com> <http://example.com> .";
/// store.load_dataset(file.as_ref(), DatasetSyntax::NQuads, None);
/// store.load_dataset(file.as_ref(), DatasetSyntax::NQuads, None)?;
///
/// // quad filter
/// let results: Vec<Quad> = store.quads_for_pattern(None, None, None, None).collect();

Loading…
Cancel
Save