Created
January 30, 2024 01:40
-
-
Save jmcph4/4b90258fc6117b1b386b1eceae279adc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let top_val: serde_json::Value = serde_json::from_str(raw.as_ref())?; | |
| let inner_val: &serde_json::Value = top_val | |
| .get( | |
| top_val | |
| .as_object() | |
| .unwrap() | |
| .keys() | |
| .collect::<Vec<_>>() | |
| .first() | |
| .unwrap(), | |
| ) | |
| .unwrap(); | |
| let back_to_json: String = serde_json::to_string(inner_val)?; | |
| Ok(serde_json::from_str(&back_to_json)?) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment