Rollup merge of #107909 - notriddle:notriddle/register-header-empty-cond, r=camelid

rustdoc: remove redundant `if s.is_empty()` from `find_testable_code`
This commit is contained in:
Matthias Krüger 2023-02-11 17:18:45 +01:00 committed by GitHub
commit f95f68e619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -740,11 +740,7 @@ pub(crate) fn find_testable_code<T: doctest::Tester>(
}
Event::Text(ref s) if register_header.is_some() => {
let level = register_header.unwrap();
if s.is_empty() {
tests.register_header("", level);
} else {
tests.register_header(s, level);
}
tests.register_header(s, level);
register_header = None;
}
_ => {}