Skip to content

Commit f5faf62

Browse files
authored
Easier new methods for ExtRequest + ExtNotification (#271)
In practice, this made things harder not easier. Using a more concrete type to make it easier to use `raw_json!`
1 parent 836537b commit f5faf62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rust/ext.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ pub struct ExtRequest {
1616
}
1717

1818
impl ExtRequest {
19-
pub fn new(method: impl Into<Arc<str>>, params: impl Into<Arc<RawValue>>) -> Self {
19+
pub fn new(method: impl Into<Arc<str>>, params: Arc<RawValue>) -> Self {
2020
Self {
2121
method: method.into(),
22-
params: params.into(),
22+
params,
2323
}
2424
}
2525
}
@@ -37,10 +37,10 @@ pub struct ExtNotification {
3737
}
3838

3939
impl ExtNotification {
40-
pub fn new(method: impl Into<Arc<str>>, params: impl Into<Arc<RawValue>>) -> Self {
40+
pub fn new(method: impl Into<Arc<str>>, params: Arc<RawValue>) -> Self {
4141
Self {
4242
method: method.into(),
43-
params: params.into(),
43+
params,
4444
}
4545
}
4646
}

0 commit comments

Comments
 (0)