@@ -241,14 +241,12 @@ async fn get_users_llm_toon() -> LlmResponse<UsersResponse> {
241241/// Compare JSON vs TOON for the same data
242242async fn compare_formats ( ) -> Json < ComparisonResult > {
243243 let users = get_sample_users ( ) ;
244- let response = UsersResponse {
245- users,
246- total : 3 ,
247- } ;
244+ let response = UsersResponse { users, total : 3 } ;
248245
249246 // Serialize to both formats
250247 let json_str = serde_json:: to_string_pretty ( & response) . unwrap ( ) ;
251- let toon_str = rustapi_rs:: toon:: encode_default ( & response) . unwrap_or_else ( |_| "Error" . to_string ( ) ) ;
248+ let toon_str =
249+ rustapi_rs:: toon:: encode_default ( & response) . unwrap_or_else ( |_| "Error" . to_string ( ) ) ;
252250
253251 let json_bytes = json_str. len ( ) ;
254252 let toon_bytes = toon_str. len ( ) ;
@@ -266,7 +264,8 @@ async fn compare_formats() -> Json<ComparisonResult> {
266264/// API info
267265async fn index ( ) -> Json < Message > {
268266 Json ( Message {
269- content : "TOON Format API Example - Use /compare to see JSON vs TOON comparison" . to_string ( ) ,
267+ content : "TOON Format API Example - Use /compare to see JSON vs TOON comparison"
268+ . to_string ( ) ,
270269 format : "json" . to_string ( ) ,
271270 } )
272271}
@@ -293,7 +292,9 @@ async fn toon_docs() -> Html<String> {
293292 <p><a href="/docs">Back to API Documentation</a></p>
294293</body>
295294</html>"# ,
296- TOON_FORMAT_DESCRIPTION . replace( '<' , "<" ) . replace( '>' , ">" )
295+ TOON_FORMAT_DESCRIPTION
296+ . replace( '<' , "<" )
297+ . replace( '>' , ">" )
297298 ) ;
298299 Html ( html)
299300}
@@ -303,9 +304,7 @@ async fn toon_docs() -> Html<String> {
303304#[ tokio:: main]
304305async fn main ( ) -> std:: result:: Result < ( ) , Box < dyn std:: error:: Error + Send + Sync > > {
305306 // Initialize tracing
306- tracing_subscriber:: fmt ( )
307- . with_env_filter ( "info" )
308- . init ( ) ;
307+ tracing_subscriber:: fmt ( ) . with_env_filter ( "info" ) . init ( ) ;
309308
310309 info ! ( "Starting TOON API example..." ) ;
311310 info ! ( "Server running at http://127.0.0.1:8080" ) ;
@@ -331,8 +330,8 @@ async fn main() -> std::result::Result<(), Box<dyn std::error::Error + Send + Sy
331330 info ! ( " curl -H 'Accept: application/toon' http://localhost:8080/users # TOON" ) ;
332331
333332 // Build API description with TOON support notice
334- let description = api_description_with_toon (
335- "TOON Format API Example demonstrating LLM-optimized data serialization."
333+ let _description = api_description_with_toon (
334+ "TOON Format API Example demonstrating LLM-optimized data serialization." ,
336335 ) ;
337336
338337 RustApi :: new ( )
0 commit comments