feat: more readable output

thanks to https://stackoverflow.com/questions/72637174/pretty-print-struct-in-rust
This commit is contained in:
selene 2025-12-18 21:15:54 +01:00
parent 226b880fb6
commit 26309312e8
Signed by: sel
SSH key fingerprint: SHA256:33R/4Rx5Lu4o81LyJyXdMrmP5CJ6j7j1Soo0Dn7mKc0

View file

@ -20,10 +20,10 @@ fn main() -> Result<(), String> {
let transform_destination = "meta/number:value";
// this creates a new object instance
let some_object = ObjectInstance::from_template(object_type, input)?;
let some_object = ObjectInstance::from_object_type(object_type, input)?;
println!("this is an object:");
println!("{:?}", some_object);
println!("{:#?}", some_object);
println!("");
// this runs a function on it to calculate other properties
@ -36,13 +36,13 @@ fn main() -> Result<(), String> {
};
println!("this is the same object with data:");
println!("{:?}", some_object_with_data);
println!("{:#?}", some_object_with_data);
println!("");
let transformed = ObjectInstance::transform(&some_object_with_data, transform_source, transform_destination)?;
println!("this is what happens when we transform the {} property into a new {}:", transform_source, transform_destination);
println!("{:?}", transformed);
println!("{:#?}", transformed);
Ok(())
}