The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Deserialize An Integer

TODO: Pull subtitle into page object
Code
//! ```cargo
//! [dependencies]
//! serde = { version = "1.0.195", features = ["derive"] }
//! serde_json = "1.0.111"
//! ```

#![allow(dead_code)]
use serde::Deserialize;
use serde_json;

#[derive(Debug, Deserialize)]
pub struct Widget {
  value: i32
}

fn main() {
  let json_string = r#"{ "value": -5 }"#;
  let data: Widget = serde_json::from_str(json_string).unwrap();
  println!("{:?}", data);
}
Results
Widget { value: -5 }

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Deserialize An Integer

This is a test to bug hunt a problem
I'm having in Neopoligen. It's working here
as expected. Still TBD on what's up with 
the other thing.

-- code
-- rust

//! ```cargo
//! [dependencies]
//! serde = { version = "1.0.195", features = ["derive"] }
//! serde_json = "1.0.111"
//! ```

#![allow(dead_code)]
use serde::Deserialize;
use serde_json;

#[derive(Debug, Deserialize)]
pub struct Widget {
  value: i32
}

fn main() {
  let json_string = r#"{ "value": -5 }"#;
  let data: Widget = serde_json::from_str(json_string).unwrap();
  println!("{:?}", data);
}

-- results/

Widget { value: -5 }

-- /results


-- metadata
-- date: 2024-01-18 02:39:00
-- id: 2b7qgloy
-- type: rust 
-- status: published