Skip to content
New issue

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

Deserializing a ClientType requires an input with static lifetime #206

Closed
5 tasks
kevinji opened this issue Oct 28, 2022 · 0 comments · Fixed by #205
Closed
5 tasks

Deserializing a ClientType requires an input with static lifetime #206

kevinji opened this issue Oct 28, 2022 · 0 comments · Fixed by #205

Comments

@kevinji
Copy link
Contributor

kevinji commented Oct 28, 2022

Summary of Bug

ClientType contains a &'static str, which makes it impossible to Deserialize ClientType without leaking memory.

Version

0.21.1

Steps to Reproduce

Here's a simplified example of the issue, reproduced below:

use serde::Deserialize;
use serde_json;

#[derive(Deserialize)]
struct WithStaticStr(&'static str);

fn from_json(json_str: &str) -> WithStaticStr {
    serde_json::from_str(&json_str).unwrap()
}

There's no way to make this code compile besides giving json_str a &'static str lifetime.

Acceptance Criteria

Fix ClientType to contain a String instead of a &'static str.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@plafer plafer changed the title Deserializing a ClientType requires leaking memory Deserializing a ClientType requires an input with static lifetime Oct 31, 2022
shuoer86 pushed a commit to shuoer86/ibc-rs that referenced this issue Nov 4, 2023
)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.13.0 to 0.14.0.
- [Commits](golang/crypto@v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant