(&self, locale: Locale)
| 273 | |
| 274 | impl RepoTopicMetadata { |
| 275 | pub fn name(&self, locale: Locale) -> &str { |
| 276 | let synonyms = self.synonyms(); |
| 277 | |
| 278 | for synonym in synonyms.iter() { |
| 279 | if synonym.locale == locale { |
| 280 | return &synonym.name; |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | if let Some(synonym) = synonyms.first() { |
| 285 | return &synonym.name; |
| 286 | } |
| 287 | |
| 288 | "[missing name]" |
| 289 | } |
| 290 | |
| 291 | pub fn synonyms(&self) -> &[Synonym] { |
| 292 | match &self.details { |