Closed
Description
When creating a byte literal with single quotes, like b'hello\0'
, The error message says:
error: character literal may only contain one codepoint
--> src/wire_protocol/operations.rs:101:37
|
101 | assert_eq!(Bson::Binary(4, b'12345').byte_length().unwrap(), 10);
| ^^^^^^^
help: if you meant to write a `str` literal, use double quotes
|
101 | assert_eq!(Bson::Binary(4, b"12345").byte_length().unwrap(), 10);
| ^^^^^^^
But following the directions would not give us a str
literal, it would give a [u8]
literal.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsCategory: An issue proposing an enhancement or a PR with one.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.