Skip to content

Commit 8e9193f

Browse files
committed
miscellaneous documentation improvements
1 parent 493412a commit 8e9193f

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

src/factory.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use web_sys::{
1313

1414
/// Wrapper for [`IDBFactory`](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory)
1515
///
16-
/// Note that it's quite likely that type inference will fail on the `Err` generic argument here.
16+
/// Note that it is quite likely that type inference will fail on the `Err` generic argument here.
1717
/// This argument is the type of user-defined errors that will be passed through transactions and
1818
/// callbacks.
1919
/// You should set it to whatever error type your program uses around the `indexed-db`-using code.
@@ -85,8 +85,8 @@ impl<Err: 'static> Factory<Err> {
8585
/// Returns an error if something failed while opening or upgrading the database.
8686
/// Blocks until it can actually open the database.
8787
///
88-
/// Note that `version` must be at least `1`. `upgrader` will be called when `version` is higher than the previous
89-
/// database version, or upon database creation.
88+
/// Note that `version` must be at least `1`. `on_upgrade_needed` will be called when `version` is higher
89+
/// than the previous database version, or upon database creation.
9090
///
9191
/// This internally uses [`IDBFactory::open`](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open)
9292
/// as well as the methods from [`IDBOpenDBRequest`](https://developer.mozilla.org/en-US/docs/Web/API/IDBOpenDBRequest)
@@ -183,14 +183,14 @@ impl<Err> VersionChangeEvent<Err> {
183183

184184
/// The version before the database upgrade, clamped to `u32::MAX`
185185
///
186-
/// Internally, this uses [`IDBVersionChangeEvent::old_version`](https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeEvent/oldVersion)
186+
/// Internally, this uses [`IDBVersionChangeEvent::oldVersion`](https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeEvent/oldVersion)
187187
pub fn old_version(&self) -> u32 {
188188
self.sys.old_version() as u32
189189
}
190190

191191
/// The version after the database upgrade, clamped to `u32::MAX`
192192
///
193-
/// Internally, this uses [`IDBVersionChangeEvent::new_version`](https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeEvent/newVersion)
193+
/// Internally, this uses [`IDBVersionChangeEvent::newVersion`](https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeEvent/newVersion)
194194
pub fn new_version(&self) -> u32 {
195195
self.sys
196196
.new_version()

src/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl<Err> Index<Err> {
156156
}
157157
}
158158

159-
/// List all the keys in the object store, with a maximum number of results of `limit`, ordered by this index
159+
/// List all the keys (for this index) in the object store, with a maximum number of results of `limit`, ordered by this index
160160
///
161161
/// Internally, this uses [`IDBIndex::getAllKeys`](https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/getAllKeys).
162162
pub fn get_all_keys(

src/object_store.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ impl<Err> ObjectStore<Err> {
5252

5353
/// Delete an index from this object store
5454
///
55-
/// Note that this method can only be called from within an `on_upgrade_needed` callback. It returns
56-
/// a builder, and calling the `create` method on this builder will perform the actual creation.
55+
/// Note that this method can only be called from within an `on_upgrade_needed` callback.
5756
///
5857
/// Internally, this uses [`IDBObjectStore::deleteIndex`](https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/deleteIndex).
5958
pub fn delete_index(&self, name: &str) -> crate::Result<(), Err> {
@@ -66,7 +65,7 @@ impl<Err> ObjectStore<Err> {
6665
})
6766
}
6867

69-
/// Add the value `val` to this object store, and return its auto-computed key
68+
/// Add the value `value` to this object store, and return its auto-computed key
7069
///
7170
/// This will error if the key already existed.
7271
///
@@ -78,7 +77,7 @@ impl<Err> ObjectStore<Err> {
7877
}
7978
}
8079

81-
/// Add the value `val` to this object store, with key `key`
80+
/// Add the value `value` to this object store, with key `key`
8281
///
8382
/// This will error if the key already existed.
8483
///
@@ -96,7 +95,7 @@ impl<Err> ObjectStore<Err> {
9695
}
9796
}
9897

99-
/// Sets the value `val` to this object store, and return its auto-computed key
98+
/// Add the value `value` to this object store, and return its auto-computed key
10099
///
101100
/// This will overwrite the previous value if the key already existed.
102101
///
@@ -108,7 +107,7 @@ impl<Err> ObjectStore<Err> {
108107
}
109108
}
110109

111-
/// Add the value `val` to this object store, with key `key`
110+
/// Add the value `value` to this object store, with key `key`
112111
///
113112
/// This will overwrite the previous value if the key already existed.
114113
///
@@ -126,7 +125,7 @@ impl<Err> ObjectStore<Err> {
126125
}
127126
}
128127

129-
/// Clears this object store
128+
/// Clear this object store
130129
///
131130
/// Internally, this uses [`IDBObjectStore::clear`](https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/clear).
132131
pub fn clear(&self) -> impl Future<Output = crate::Result<(), Err>> {
@@ -144,7 +143,7 @@ impl<Err> ObjectStore<Err> {
144143
}
145144
}
146145

147-
/// Counts the number of objects in this store
146+
/// Count the number of objects in this store
148147
///
149148
/// Internally, this uses [`IDBObjectStore::count`](https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/count).
150149
pub fn count(&self) -> impl Future<Output = crate::Result<usize, Err>> {

src/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<Err> Transaction<Err> {
146146

147147
/// Returns an [`ObjectStore`] that can be used to operate on data in this transaction
148148
///
149-
/// Internally, this uses [`IDBTransaction::object_store`](https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/objectStore).
149+
/// Internally, this uses [`IDBTransaction::objectStore`](https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/objectStore).
150150
pub fn object_store(&self, name: &str) -> crate::Result<ObjectStore<Err>, Err> {
151151
Ok(ObjectStore::from_sys(self.sys.object_store(name).map_err(
152152
|err| match error_name!(&err) {

0 commit comments

Comments
 (0)