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
| fn main() { | |
| /// copy of the macro dbg!, just modified :#? to :# for pretty print | |
| #[macro_export] | |
| macro_rules! pretty_dbg { | |
| () => { | |
| std::eprintln!("[{}:{}]", std::file!(), std::line!()) | |
| }; | |
| ($val:expr $(,)?) => { | |
| match $val { | |
| tmp => { |
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
| use serde_json; | |
| use anyhow::Result; | |
| /// copy of the macro dbg!, just modified :#? to :# for pretty print | |
| #[macro_export] | |
| macro_rules! pretty_dbg { | |
| () => { | |
| std::eprintln!("[{}:{}]", std::file!(), std::line!()) | |
| }; | |
| ($val:expr $(,)?) => { |
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
| /// copy of the macro dbg!, just modified :#? to :# for pretty print | |
| #[macro_export] | |
| macro_rules! pretty_dbg { | |
| () => { | |
| std::eprintln!("[{}:{}]", std::file!(), std::line!()) | |
| }; | |
| ($val:expr $(,)?) => { | |
| match $val { | |
| tmp => { | |
| std::eprintln!("[{}:{}] {} = {:#}", |
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
| use serde_json; | |
| use anyhow::Result; | |
| fn main() -> Result<(), anyhow::Error>{ | |
| let response_text = | |
| r#"{ | |
| "id": 1296269, | |
| "homepage": "https://github.com" | |
| }"#; | |
| let parsed_json_value: serde_json::Value = serde_json::from_str(response_text)?; |
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
| fn main() { | |
| let json_str = r#" | |
| { | |
| owner: 'bestia-dev', | |
| repository_details: { | |
| general: { | |
| description: 'testing the creation of a github repo', | |
| }, | |
| }, | |
| } |