Skip to content

Commit

Permalink
AVRO-3925: [Rust] Improve formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g committed Jan 4, 2024
1 parent 4295bc2 commit 08a53e6
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions lang/rust/avro/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ fn schema_name_r() -> &'static Regex {
SCHEMA_NAME_ONCE.get_or_init(|| {
Regex::new(
r"^((?P<namespace>([A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*)?)\.)?(?P<name>[A-Za-z_][A-Za-z0-9_]*)$",
)
.unwrap()
).unwrap()
})
}

Expand Down Expand Up @@ -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(())
Expand All @@ -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(())
Expand Down

0 comments on commit 08a53e6

Please sign in to comment.