Skip to content

Commit b923d52

Browse files
authored
fix fixed size array formatting in doc signature formatting (#7845)
1 parent b4a5a32 commit b923d52

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

crates/cairo-lang-doc/src/documentable_formatter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ fn is_the_same_root(path1: &str, path2: &str) -> bool {
668668
/// Formats complex types full paths. For example "Result<Error::NotFound, System::Error>" input
669669
/// results in "Result<NotFound, Error>" output.
670670
fn extract_and_format(input: &str) -> String {
671-
let delimiters = [',', '<', '>', '(', ')'];
671+
let delimiters = [',', '<', '>', '(', ')', '[', ']'];
672672
let mut output = String::new();
673673
let mut slice_start = 0;
674674
let mut in_slice = false;

crates/cairo-lang-doc/src/tests/test-data/signature.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ fn this_function_has_a_very_long_signature(
7474
yet_another_linked_parameter_at_the_end: Circle,
7575
) -> Circle {}
7676

77+
fn test_fixed_size_array(param: [u32; 8]) -> [u32; 8] {
78+
return param;
79+
}
80+
7781
//! > Item signature #1
7882

7983
//! > Item documentation #1
@@ -291,3 +295,10 @@ fn this_function_has_a_very_long_signature(
291295
//! > Item documentation #28
292296

293297
//! > Item documentation tokens #28
298+
299+
//! > Item signature #29
300+
fn test_fixed_size_array(param: [u32; 8]) -> [u32; 8]
301+
302+
//! > Item documentation #29
303+
304+
//! > Item documentation tokens #29

0 commit comments

Comments
 (0)