with_desugared_doc: correctly refer to attr instead of self

Co-Authored-By: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
This commit is contained in:
Mazdak Farrokhzad 2019-10-25 10:43:08 +02:00 committed by GitHub
parent 0a5b38f9c3
commit 9e3e3a470e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -859,8 +859,8 @@ impl Attributes {
let mut cfg = Cfg::True;
let mut doc_line = 0;
/// Converts `self` to a normal `#[doc="foo"]` comment, if it is a
/// comment like `///` or `/** */`. (Returns `self` unchanged for
/// Converts `attr` to a normal `#[doc="foo"]` comment, if it is a
/// comment like `///` or `/** */`. (Returns `attr` unchanged for
/// non-sugared doc attributes.)
pub fn with_desugared_doc<T>(attr: &Attribute, f: impl FnOnce(&Attribute) -> T) -> T {
if attr.is_sugared_doc {