router: fix impl Index for dyn RpcEnvironment
implement Index and IndexMut on `dyn RpcEnvironment` rather than on a reference to it Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
47c9bed30d
commit
39956b5d09
@ -57,6 +57,20 @@ pub enum RpcEnvironmentType {
|
||||
PRIVILEGED,
|
||||
}
|
||||
|
||||
impl core::ops::Index<&str> for dyn RpcEnvironment {
|
||||
type Output = Value;
|
||||
fn index(&self, index: &str) -> &Value {
|
||||
self.result_attrib().index(index)
|
||||
}
|
||||
}
|
||||
|
||||
impl core::ops::IndexMut<&str> for dyn RpcEnvironment {
|
||||
fn index_mut(&mut self, index: &str) -> &mut Value {
|
||||
self.result_attrib_mut().index_mut(index)
|
||||
}
|
||||
}
|
||||
|
||||
// deprecated Index variants:
|
||||
impl core::ops::Index<&str> for &dyn RpcEnvironment {
|
||||
type Output = Value;
|
||||
fn index(&self, index: &str) -> &Value {
|
||||
|
Loading…
Reference in New Issue
Block a user