-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add implementation on Option is confusing #8127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think this might be a dup of #6002, but what does this have to do with |
@bstrie: Maybe I expressed it strange :) What I mean is: If the implementation is such that My talk about |
Anyway, this is indeed a duplicate of that issue, closing this one. |
Fix `enum_variants` FP on prefixes that are not camel-case closes rust-lang#8090 Fix FP on `enum_variants` when prefixes are only a substring of a camel-case word. Also adds some util helpers on `str_utils` to help parsing camel-case strings. This changes how the lint behaves: 1. previously if the Prefix is only a length of 1, it's going to get ignored, i.e. these were previously ignored and now is warned ```rust enum Foo { cFoo, cBar, cBaz, } enum Something { CCall, CCreate, CCryogenize, } ``` 2. non-ascii characters that doesn't have casing will not be split, ```rust enum NonCaps { PrefixXXX, PrefixTea, PrefixCake, } ``` will be considered as `PrefixXXX`, `Prefix`, `Prefix`, so this won't lint as opposed to fired previously. changelog: [`enum_variant_names`] Fix FP when first prefix are only a substring of a camel-case word. --- (Edited by `@xFrednet` removed some non ascii characters)
Right now add on two Options effectively treats a
None
as aSome(Zero::zero())
, which is:Some(Zero::zero())
is already a valid value, why duplicate it's meaning withNone
?Maybe
Monad in Haskell works: If both values are aSome
, add them, else returnNone
.The text was updated successfully, but these errors were encountered: