# languages: Remove a eager conversion from \`LanguageName\` to \`String\` \(\#35667\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/c595ed19d6908fd6a9310013d2cfd75613a8968f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: c595ed19d6908fd6a9310013d2cfd75613a8968f

Requested commit: c595ed19d6908fd6a9310013d2cfd75613a8968f

Commit: c595ed19d6908fd6a9310013d2cfd75613a8968f

Tree: 1284875cf4e63abdaeebe2f1a05d11813448e3d5

Author: tidely

Committer: GitHub

## Message

````
languages:  Remove a eager conversion from `LanguageName` to `String` (#35667)

This PR changes the signature of `language_names` from

```rust
pub fn language_names(&self) -> Vec<String>
// Into
pub fn language_names(&self) -> Vec<LanguageName>
```

The function previously eagerly converted `LanguageName`'s to
`String`'s, which requires the reallocation of all of the elements. The
functions get called in many places in the code base, but only one of
which actually requires the conversion to a `String`. In one case it
would do a `SharedString` -> `String` -> `SharedString` conversion,
which is now totally bypassed.

Release Notes:

- N/A
````

## Parents

- [a508a9536fb4a8b46e36ef74ef23a642f17daab6](https://git.cafe/gitcafe/zed/commit/a508a9536fb4a8b46e36ef74ef23a642f17daab6?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/c595ed19d6908fd6a9310013d2cfd75613a8968f?format=markdown)
