diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-02-28 14:20:33 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-02-28 15:16:27 +0100 |
| commit | 9523c89f18ca62c992e580fc33fe1bf092696d8d (patch) | |
| tree | fe98aa841d6ff82631ffc933c6f632f16e96546f /src/librustdoc/clean/mod.rs | |
| parent | e2223c94bf433fc38234d1303e88cbaf14755863 (diff) | |
| download | rust-9523c89f18ca62c992e580fc33fe1bf092696d8d.tar.gz rust-9523c89f18ca62c992e580fc33fe1bf092696d8d.zip | |
use is_empty() instead of len() == x to determine if structs are empty.
Diffstat (limited to 'src/librustdoc/clean/mod.rs')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 50c780e9ecb..8be6bf8f0d3 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -398,7 +398,7 @@ impl Clean<Lifetime> for hir::GenericParam<'_> { fn clean(&self, _: &DocContext<'_>) -> Lifetime { match self.kind { hir::GenericParamKind::Lifetime { .. } => { - if self.bounds.len() > 0 { + if !self.bounds.is_empty() { let mut bounds = self.bounds.iter().map(|bound| match bound { hir::GenericBound::Outlives(lt) => lt, _ => panic!(), @@ -607,7 +607,7 @@ impl Clean<GenericParamDef> for hir::GenericParam<'_> { fn clean(&self, cx: &DocContext<'_>) -> GenericParamDef { let (name, kind) = match self.kind { hir::GenericParamKind::Lifetime { .. } => { - let name = if self.bounds.len() > 0 { + let name = if !self.bounds.is_empty() { let mut bounds = self.bounds.iter().map(|bound| match bound { hir::GenericBound::Outlives(lt) => lt, _ => panic!(), |
