Skip to content

Mark the CompressionOptions(int) constructor explicit - #263

Merged
danilak-G merged 1 commit into
google:mainfrom
rvandermeulen:explicit-compression-options
Sep 18, 2026
Merged

danilak-G merged 1 commit into
google:mainfrom
rvandermeulen:explicit-compression-options

Conversation

@rvandermeulen

Copy link
Copy Markdown
Contributor

A single-argument constructor without explicit lets an int convert implicitly to CompressionOptions, so an accidental Compress(reader, writer, 2) compiles silently. Nothing in the library relies on the conversion, and the style guide asks for explicit on single-argument constructors. Firefox has carried this as a local patch since 1.2.0.

A single-argument constructor without explicit allows an int to convert
implicitly to CompressionOptions, so an accidental Compress(reader, writer, 2)
compiles without complaint. Nothing in the library relies on the conversion.
@danilak-G
danilak-G merged commit cd74318 into google:main Sep 18, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants