From 564fa155d4ac40efe5d83a7383bb251189bb882a Mon Sep 17 00:00:00 2001 From: Declan Kelly Date: Mon, 30 Sep 2019 14:14:52 -0700 Subject: [PATCH] Correct mutability in on demand example, fix doc links Fix query_mut documentation link Fix more documentation links More doc links --- book/src/common_patterns/on_demand_inputs.md | 4 ++-- src/lib.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/book/src/common_patterns/on_demand_inputs.md b/book/src/common_patterns/on_demand_inputs.md index 7eea3995..0bd2faa8 100644 --- a/book/src/common_patterns/on_demand_inputs.md +++ b/book/src/common_patterns/on_demand_inputs.md @@ -22,7 +22,7 @@ trait VfsDatabase: salsa::Database + FileWatcher { trait FileWatcher { fn watch(&self, path: &Path); - fn did_change_file(&self, path: &Path); + fn did_change_file(&mut self, path: &Path); } fn read(db: &impl salsa::Database, path: PathBuf) -> String { @@ -37,7 +37,7 @@ struct MyDatabase { ... } impl FileWatcher for MyDatabase { fn watch(&self, path: &Path) { ... } - fn did_change_file(&self, path: &Path) { + fn did_change_file(&mut self, path: &Path) { self.query_mut(ReadQuery).invalidate(path); } } diff --git a/src/lib.rs b/src/lib.rs index e003b360..427430ad 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -377,7 +377,7 @@ pub trait ParallelDatabase: Database + Send { /// only gives `&self` access to it. See [the `snapshot` method][fm] /// for more details. /// -/// [fm]: trait.ParallelDatabase#method.snapshot +/// [fm]: trait.ParallelDatabase.html#method.snapshot #[derive(Debug)] pub struct Snapshot where @@ -451,7 +451,7 @@ pub unsafe trait Query: Debug + Default + Sized + 'static { /// Return value from [the `query` method] on `Database`. /// Gives access to various less common operations on queries. /// -/// [the `query_mut` method]: trait.Database#method.query +/// [the `query` method]: trait.Database.html#method.query pub struct QueryTable<'me, DB, Q> where DB: plumbing::GetQueryTable, @@ -497,7 +497,7 @@ where /// Gives access to the `set` method, notably, that is used to /// set the value of an input query. /// -/// [the `query_mut` method]: trait.Database#method.query_mut +/// [the `query_mut` method]: trait.Database.html#method.query_mut pub struct QueryTableMut<'me, DB, Q> where DB: plumbing::GetQueryTable, @@ -527,7 +527,7 @@ where /// If you are using `snapshot`, see the notes on blocking /// and cancellation on [the `query_mut` method]. /// - /// [the `query_mut` method]: trait.Database#method.query_mut + /// [the `query_mut` method]: trait.Database.html#method.query_mut pub fn set(&mut self, key: Q::Key, value: Q::Value) where Q::Storage: plumbing::InputQueryStorageOps, @@ -542,7 +542,7 @@ where /// If you are using `snapshot`, see the notes on blocking /// and cancellation on [the `query_mut` method]. /// - /// [the `query_mut` method]: trait.Database#method.query_mut + /// [the `query_mut` method]: trait.Database.html#method.query_mut pub fn set_with_durability(&mut self, key: Q::Key, value: Q::Value, durability: Durability) where Q::Storage: plumbing::InputQueryStorageOps,