Skip to content

Commit 6f9186d

Browse files
committed
nostr: improve Filter coordinate methods docs
Specify that coordinate methods in `Filter` struct are related to `a` tag. Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 5627c40 commit 6f9186d

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

bindings/nostr-ffi/src/types/filter.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ impl Filter {
302302

303303
/// Add coordinate
304304
///
305+
/// Query for `a` tag.
306+
///
305307
/// <https://github.com/nostr-protocol/nips/blob/master/01.md>
306308
pub fn coordinate(self: Arc<Self>, coordinate: &Coordinate) -> Self {
307309
let mut builder = unwrap_or_clone_arc(self);
@@ -311,6 +313,8 @@ impl Filter {
311313

312314
/// Add coordinates
313315
///
316+
/// Query for `a` tags.
317+
///
314318
/// <https://github.com/nostr-protocol/nips/blob/master/01.md>
315319
pub fn coordinates(self: Arc<Self>, coordinates: Vec<Arc<Coordinate>>) -> Self {
316320
let mut builder = unwrap_or_clone_arc(self);
@@ -322,6 +326,8 @@ impl Filter {
322326

323327
/// Remove coordinates
324328
///
329+
/// Remove `a` tags.
330+
///
325331
/// <https://github.com/nostr-protocol/nips/blob/master/01.md>
326332
pub fn remove_coordinates(self: Arc<Self>, coordinates: Vec<Arc<Coordinate>>) -> Self {
327333
let mut builder = unwrap_or_clone_arc(self);

bindings/nostr-js/src/types/filter.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,17 @@ impl JsFilter {
358358

359359
/// Add coordinate
360360
///
361+
/// Query for `a` tag.
362+
///
361363
/// <https://github.com/nostr-protocol/nips/blob/master/01.md>
362364
pub fn coordinate(self, coordinate: &JsCoordinate) -> Self {
363365
self.inner.coordinate(coordinate.deref()).into()
364366
}
365367

366368
/// Set coordinates
367369
///
370+
/// Query for `a` tags.
371+
///
368372
/// <https://github.com/nostr-protocol/nips/blob/master/01.md>
369373
pub fn coordinates(self, coordinates: Vec<JsCoordinate>) -> Self {
370374
self.inner
@@ -374,6 +378,8 @@ impl JsFilter {
374378

375379
/// Remove coordinates
376380
///
381+
/// Remove `a` tags.
382+
///
377383
/// <https://github.com/nostr-protocol/nips/blob/master/01.md>
378384
#[wasm_bindgen(js_name = removeCoordinates)]
379385
pub fn remove_coordinates(self, coordinates: Vec<JsCoordinate>) -> Self {

crates/nostr/src/types/filter.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,8 @@ impl Filter {
556556

557557
/// Add coordinate
558558
///
559+
/// Query for `a` tag.
560+
///
559561
/// <https://github.com/nostr-protocol/nips/blob/master/01.md>
560562
#[inline]
561563
pub fn coordinate(self, coordinate: &Coordinate) -> Self {
@@ -567,6 +569,8 @@ impl Filter {
567569

568570
/// Add coordinates
569571
///
572+
/// Query for `a` tags.
573+
///
570574
/// <https://github.com/nostr-protocol/nips/blob/master/01.md>
571575
#[inline]
572576
pub fn coordinates<'a, I>(self, coordinates: I) -> Self
@@ -581,6 +585,8 @@ impl Filter {
581585

582586
/// Remove coordinates
583587
///
588+
/// Remove `a` tags.
589+
///
584590
/// <https://github.com/nostr-protocol/nips/blob/master/01.md>
585591
#[inline]
586592
pub fn remove_coordinates<'a, I>(self, coordinates: I) -> Self

0 commit comments

Comments
 (0)