We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5773838 commit 19ca9a4Copy full SHA for 19ca9a4
1 file changed
xtask/src/codegen/feature_docs.rs
@@ -58,20 +58,27 @@ impl Feature {
58
}
59
60
fn is_valid_feature_name(feature: &str) -> Result<(), String> {
61
+ let mut in_code = false;
62
'word: for word in feature.split_whitespace() {
- for short in ["to", "and"] {
63
+ for short in ["to", "and", "of"] {
64
if word == short {
65
continue 'word;
66
67
- for short in ["To", "And"] {
68
+ for short in ["To", "And", "Of"] {
69
70
return Err(format!("Don't capitalize {word:?}"));
71
72
- if !word.starts_with(char::is_uppercase) {
73
+ if word.starts_with('`') {
74
+ in_code = true;
75
+ }
76
+ if !in_code && !word.starts_with(char::is_uppercase) {
77
return Err(format!("Capitalize {word:?}"));
78
79
+ if word.ends_with('`') {
80
+ in_code = false;
81
82
83
Ok(())
84
0 commit comments