Skip to content

Commit f41d586

Browse files
committed
shared: remove pointless as_ref
I believe the signature of the constructor was originally generic over `AsRef<[u8]>`, but it got changed to be concrete. However, the implementation continued calling `as_ref()` unnecessarily. This looks harmless, but exposes us to inference failures. Ref rust-lang/rust#139441
1 parent 9aeb3f1 commit f41d586

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/shared/posix.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ impl PosixTimeZone<Abbreviation> {
2222
// `0..=24`.) Requiring strict POSIX rules doesn't seem necessary
2323
// since the extension is a strict superset. Plus, GNU tooling
2424
// seems to accept the extension.
25-
let parser =
26-
Parser { ianav3plus: true, ..Parser::new(bytes.as_ref()) };
25+
let parser = Parser { ianav3plus: true, ..Parser::new(bytes) };
2726
parser.parse()
2827
}
2928

@@ -34,8 +33,7 @@ impl PosixTimeZone<Abbreviation> {
3433
pub fn parse_prefix<'b>(
3534
bytes: &'b [u8],
3635
) -> Result<(PosixTimeZone<Abbreviation>, &'b [u8]), Error> {
37-
let parser =
38-
Parser { ianav3plus: true, ..Parser::new(bytes.as_ref()) };
36+
let parser = Parser { ianav3plus: true, ..Parser::new(bytes) };
3937
parser.parse_prefix()
4038
}
4139
// only-jiff-end

0 commit comments

Comments
 (0)