File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 89
89
* nostr: add ` EventId::from_byte_array ` ([ Yuki Kishimoto] )
90
90
* nostr: add ` Timestamp::min ` and ` Timestamp::max ` ([ Yuki Kishimoto] )
91
91
* nostr: add ` nip65::extract_owned_relay_list ` ([ Yuki Kishimoto] )
92
+ * nostr: add ` Kind::from_u16 ` ([ Yuki Kishimoto] )
92
93
* database: add ` DatabaseHelper::fast_query ` ([ Yuki Kishimoto] )
93
94
* database: add ` NostrDatabase::check_id ` ([ Yuki Kishimoto] )
94
95
* database: add ` NostrDatabaseExt::relay_lists ` ([ Yuki Kishimoto] )
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ impl Kind {
31
31
#[ uniffi:: constructor]
32
32
pub fn new ( kind : u16 ) -> Self {
33
33
Self {
34
- inner : nostr:: Kind :: from ( kind) ,
34
+ inner : nostr:: Kind :: from_u16 ( kind) ,
35
35
}
36
36
}
37
37
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ impl JsKind {
32
32
#[ wasm_bindgen( constructor) ]
33
33
pub fn new ( kind : u16 ) -> Self {
34
34
Self {
35
- inner : Kind :: from ( kind) ,
35
+ inner : Kind :: from_u16 ( kind) ,
36
36
}
37
37
}
38
38
Original file line number Diff line number Diff line change @@ -195,6 +195,12 @@ impl Hash for Kind {
195
195
}
196
196
197
197
impl Kind {
198
+ /// Construct from 16-bit unsigned integer
199
+ #[ inline]
200
+ pub fn from_u16 ( kind : u16 ) -> Self {
201
+ Self :: from ( kind)
202
+ }
203
+
198
204
/// Get as 16-bit unsigned integer
199
205
#[ inline]
200
206
pub fn as_u16 ( & self ) -> u16 {
You can’t perform that action at this time.
0 commit comments