mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2026-03-09 19:49:09 +00:00
Use Itertools::exactly_one in a couple more places
This commit is contained in:
parent
72b935f64a
commit
8404d0da19
@ -85,7 +85,7 @@ fn extract_doc_tt_attr(attr_flags: &mut AttrFlags, tt: ast::TokenTree) {
|
||||
|
||||
fn extract_ra_completions(attr_flags: &mut AttrFlags, tt: ast::TokenTree) {
|
||||
let tt = TokenTreeChildren::new(&tt);
|
||||
if let Ok(NodeOrToken::Token(option)) = tt.exactly_one()
|
||||
if let Ok(NodeOrToken::Token(option)) = Itertools::exactly_one(tt)
|
||||
&& option.kind().is_any_identifier()
|
||||
{
|
||||
match option.text() {
|
||||
@ -1101,7 +1101,7 @@ impl AttrFlags {
|
||||
&& (path.is1("rustc_layout_scalar_valid_range_start")
|
||||
|| path.is1("rustc_layout_scalar_valid_range_end"))
|
||||
&& let tt = TokenTreeChildren::new(&tt)
|
||||
&& let Ok(NodeOrToken::Token(value)) = tt.exactly_one()
|
||||
&& let Ok(NodeOrToken::Token(value)) = Itertools::exactly_one(tt)
|
||||
&& let Some(value) = ast::IntNumber::cast(value)
|
||||
&& let Ok(value) = value.value()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user