Skip to content

Mark the CompressionOptions(int) constructor explicit - #263

Open
rvandermeulen wants to merge 1 commit into
google:mainfrom
rvandermeulen:explicit-compression-options
Open

rvandermeulen wants to merge 1 commit into
google:mainfrom
rvandermeulen:explicit-compression-options

Conversation

@rvandermeulen

Copy link
Copy Markdown

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.
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.

1 participant