We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clone
kv::Value
Currently the only way to clone a kv::Value seems to be ToValue::to_value(), it limits the downstream kv::Value wrappers to implement Clone.
ToValue::to_value()
For example:
// #[derive(Clone)] struct Wrapper<'a>(log::kv::Value<'a>); impl Clone for Wrapper<'_> { fn clone(&self) -> Self { Self(self.0.to_value()) } }
First, the wrapper can't directly #[derive(Clone)] as kv::Value does not implement Clone.
#[derive(Clone)]
Second, the to_value() call raises a lifetime error:
to_value()
lifetime may not live long enough method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
I think adding a #[derive(Clone)] to kv::Value should be fine and it solves the problem.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Currently the only way to clone a
kv::Value
seems to beToValue::to_value()
, it limits the downstreamkv::Value
wrappers to implementClone
.For example:
First, the wrapper can't directly
#[derive(Clone)]
askv::Value
does not implementClone
.Second, the
to_value()
call raises a lifetime error:I think adding a
#[derive(Clone)]
tokv::Value
should be fine and it solves the problem.The text was updated successfully, but these errors were encountered: