lsp_plugin: change id type in jsonrpc
What changed, and why it matters
This is a small Rust code cleanup in a Lightning Service Provider (LSP) plugin. It changes a function parameter from accepting any value that can be converted into an optional string, to only accepting an already-optional string. There is no indication this fixes a security bug; it appears to be a routine type-simplification change.
No security action required. Treat as normal code maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies plugins/lsps-plugin/src/jsonrpc/mod.rs. The into_request method on the JsonRpcRequest trait previously accepted id: impl Into<Option<String>>, allowing callers to pass String, Option<String>, or similar convertible types. It now accepts id: Option<String> directly and removes the .into() conversion. This narrows the API and makes the type explicit. No logic, serialization behavior, or validation changes are visible in the diff.
Changed components
plugins/lsps-plugin/src/jsonrpc/mod.rsInspect captured patch +2 / −2
diff --git a/plugins/lsps-plugin/src/jsonrpc/mod.rs b/plugins/lsps-plugin/src/jsonrpc/mod.rs
index 78a4fa1a..b7c871ee 100644
--- a/plugins/lsps-plugin/src/jsonrpc/mod.rs
+++ b/plugins/lsps-plugin/src/jsonrpc/mod.rs
@@ -56,7 +56,7 @@ pub type Result<T> = std::result::Result<T, Error>;
/// request format.
pub trait JsonRpcRequest: Serialize {
const METHOD: &'static str;
- fn into_request(self, id: impl Into<Option<String>>) -> RequestObject<Self>
+ fn into_request(self, id: Option<String>) -> RequestObject<Self>
where
Self: Sized,
{
@@ -64,7 +64,7 @@ pub trait JsonRpcRequest: Serialize {
jsonrpc: "2.0".into(),
method: Self::METHOD.into(),
params: Some(self),
- id: id.into(),
+ id,
}
}
}
Why this scored 11/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.