Skip to content

Commit

Permalink
chore: code style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dlzht committed Jul 2, 2024
1 parent 4d14b68 commit d71cf0f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,17 +466,19 @@ mod test {
let long_method = "This_is_a_very_long_method.It_is_valid_but_unlikely.";
assert_eq!(Method::from_str(long_method).unwrap(), long_method);

// if these two assert_eq! fail, the output message may not be helpful, because type info
// of Method.Inner is not printed
let longest_inline_method = [b'A'; InlineExtension::MAX];
assert_eq!(
Method::from_bytes(&longest_inline_method).unwrap(),
Method(ExtensionInline(InlineExtension::new(&longest_inline_method).unwrap()))
Method(ExtensionInline(
InlineExtension::new(&longest_inline_method).unwrap()
))
);
let shortest_allocated_method = [b'A'; InlineExtension::MAX + 1];
assert_eq!(
Method::from_bytes(&shortest_allocated_method).unwrap(),
Method(ExtensionAllocated(AllocatedExtension::new(&shortest_allocated_method).unwrap()))
Method(ExtensionAllocated(
AllocatedExtension::new(&shortest_allocated_method).unwrap()
))
);
}
}

0 comments on commit d71cf0f

Please sign in to comment.