Skip to content

Conversation

@ftxqxd
Copy link
Contributor

@ftxqxd ftxqxd commented Jun 8, 2014

This updates identifier warnings such as struct foo_bar should have a camel case identifier to provide an example.

Closes #14738.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can actually just be

buf.extend(words.chars().enumerate().map(...));

i.e. no collect or as_slice.

In fact, the whole function can probably be

s.split('_').flat_map(|word| word.chars().enumerate().map(...)).collect::<String>()

(Could you also rename v to c?)

This updates identifier warnings such as ``struct `foo_bar` should have a
camel case identifier`` to provide an example.

Closes rust-lang#14738.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is dedenting the right way of doing this? (The line was over 100 chars long).

bors added a commit that referenced this pull request Jun 9, 2014
This updates identifier warnings such as ``struct `foo_bar` should have a
camel case identifier`` to provide an example.

Closes #14738.
@bors bors closed this Jun 9, 2014
@bors bors merged commit c1c7659 into rust-lang:master Jun 9, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 15, 2025
…ang#14740)

When a `non_std_lazy_statics` warning is generated about an item type
which can be replaced by a standard library one, ensure that the lint
happens on the item HIR node so that it can be expected.

changelog: [`non_std_lazy_statics`]: generate the warning onto the right
node

Fixes rust-lang/rust-clippy#14729

Note that this doesn't change anything on lints generated for the
`lazy_static::lazy_static` macro because the `expect` attribute cannot
be applied to a macro.
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.

Identifier format warnings should give an example

4 participants