feat: more readable output
thanks to https://stackoverflow.com/questions/72637174/pretty-print-struct-in-rust
This commit is contained in:
parent
226b880fb6
commit
26309312e8
1 changed files with 4 additions and 4 deletions
|
|
@ -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(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue