@@ -143,40 +143,40 @@ should follow:
143
143
* [ ] Crate's public interface follows the [ Rust API Guidelines] [ api-guidelines ] .
144
144
145
145
* [ ] Callback-taking APIs are generic over ` F: Fn(A) -> B ` (or ` FnMut ` or
146
- ` FnOnce ` ) instead of taking ` wasm_bindgen::Closure ` s or
147
- ` js_sys::Function ` s directly.
146
+ ` FnOnce ` ) instead of taking ` wasm_bindgen::Closure ` s or
147
+ ` js_sys::Function ` s directly.
148
148
149
149
* [ ] If the API can be implemented as a Future / Stream, then it should first
150
- be implemented as a callback, with the callback API put into the
151
- ` callback ` submodule.
150
+ be implemented as a callback, with the callback API put into the ` callback `
151
+ submodule.
152
152
153
- Then the Future / Stream should be implemented using the callback API, and
154
- should be put into the `future` or `stream` submodule.
153
+ Then the Future / Stream should be implemented using the callback API, and
154
+ should be put into the ` future ` or ` stream ` submodule.
155
155
156
- Make sure that the callback and Future / Stream APIs properly support
157
- cancellation (if it is possible to do so).
156
+ Make sure that the callback and Future / Stream APIs properly support
157
+ cancellation (if it is possible to do so).
158
158
159
159
* [ ] Uses nice Rust-y types and interfaces instead of passing around untyped
160
- ` JsValue ` s.
160
+ ` JsValue ` s.
161
161
162
162
* [ ] Has ` fn as_raw(&self) -> &web_sys::Whatever ` functions to get the
163
- underlying raw ` web_sys ` , ` js_sys ` , or ` JsValue ` type. This provides an
164
- escape hatch for dropping down to raw ` web_sys ` bindings when an API isn't
165
- fully supported by the crate yet.
163
+ underlying raw ` web_sys ` , ` js_sys ` , or ` JsValue ` type. This provides an escape
164
+ hatch for dropping down to raw ` web_sys ` bindings when an API isn't fully
165
+ supported by the crate yet.
166
166
167
- Similar for `from_raw` constructors and `into_raw` conversion methods when
168
- applicable.
167
+ Similar for ` from_raw ` constructors and ` into_raw ` conversion methods when
168
+ applicable.
169
169
170
170
* [ ] There is a loose hierarchy with "mid-level" APIs (which are essentially
171
- thin wrappers over the low-level APIs), and "high-level" APIs (which make
172
- more substantial changes).
171
+ thin wrappers over the low-level APIs), and "high-level" APIs (which make more
172
+ substantial changes).
173
173
174
- As a general rule, the high-level APIs should be built on top of the
175
- mid-level APIs, which in turn should be built on top of the low-level APIs
176
- (e.g. `web_sys`)
174
+ As a general rule, the high-level APIs should be built on top of the mid-level
175
+ APIs, which in turn should be built on top of the low-level APIs
176
+ (e.g. ` web_sys ` )
177
177
178
- There are exceptions to this, but they have to be carefully decided on a
179
- case-by-case basis.
178
+ There are exceptions to this, but they have to be carefully decided on a
179
+ case-by-case basis.
180
180
181
181
### Implementation and Feedback Cycle
182
182
@@ -204,19 +204,19 @@ Here is a checklist that all crate and API implementations in Gloo should
204
204
fulfill:
205
205
206
206
* [ ] The crate should be named ` gloo-foobar ` , located at ` gloo/crates/foobar ` ,
207
- and re-exported from the umbrella Gloo crate like:
207
+ and re-exported from the umbrella Gloo crate like:
208
208
209
- ```rust
210
- // gloo/src/lib.rs
209
+ ``` rust
210
+ // gloo/src/lib.rs
211
211
212
- pub use gloo_foobar as foobar;
213
- ```
212
+ pub use gloo_foobar as foobar;
213
+ ```
214
214
215
215
* [ ] The ` authors ` entry in ` gloo/crates/foobar/Cargo.toml ` is "The Rust and
216
- WebAssembly Working Group".
216
+ WebAssembly Working Group".
217
217
218
218
* [ ] Uses [ ` unwrap_throw ` and ` expect_throw ` ] [ unwrap-throw ] instead of normal
219
- ` unwrap ` and ` expect ` .
219
+ ` unwrap ` and ` expect ` .
220
220
221
221
* [ ] Headless browser and/or Node.js tests via ` wasm-pack test ` .
222
222
@@ -225,7 +225,7 @@ fulfill:
225
225
* [ ] Crate's root module documentation has at least one realistic example.
226
226
227
227
* [ ] Crate has at least a brief description of how to use it in the Gloo guide
228
- (the ` mdbook ` located at ` gloo/guide ` ).
228
+ (the ` mdbook ` located at ` gloo/guide ` ).
229
229
230
230
[ unwrap-throw ] : https://docs.rs/wasm-bindgen/0.2.37/wasm_bindgen/trait.UnwrapThrowExt.html
231
231
[ api-guidelines ] : https://rust-lang-nursery.github.io/api-guidelines/
0 commit comments