From 08a53e6f94391ccc96748a4fbbade9cf173a572a Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 4 Jan 2024 12:59:51 +0200 Subject: [PATCH] AVRO-3925: [Rust] Improve formatting Signed-off-by: Martin Tzvetanov Grigorov --- lang/rust/avro/src/schema.rs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs index ef9aa33ee88..b26090cf2e1 100644 --- a/lang/rust/avro/src/schema.rs +++ b/lang/rust/avro/src/schema.rs @@ -48,8 +48,7 @@ fn schema_name_r() -> &'static Regex { SCHEMA_NAME_ONCE.get_or_init(|| { Regex::new( r"^((?P([A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*)?)\.)?(?P[A-Za-z_][A-Za-z0-9_]*)$", - ) - .unwrap() + ).unwrap() }) } @@ -6433,13 +6432,13 @@ mod tests { let serialized_json = serde_json::to_string_pretty(&schema)?; let expected_json = r#"{ - "type": "fixed", - "name": "decimal_36_10", - "size": 16, - "logicalType": "decimal", - "scale": 10, - "precision": 36 -}"#; + "type": "fixed", + "name": "decimal_36_10", + "size": 16, + "logicalType": "decimal", + "scale": 10, + "precision": 36 + }"#; assert_eq!(serialized_json, expected_json); Ok(()) @@ -6456,11 +6455,11 @@ mod tests { let serialized_json = serde_json::to_string_pretty(&schema)?; let expected_json = r#"{ - "type": "bytes", - "logicalType": "decimal", - "scale": 10, - "precision": 36 -}"#; + "type": "bytes", + "logicalType": "decimal", + "scale": 10, + "precision": 36 + }"#; assert_eq!(serialized_json, expected_json); Ok(())