Refactor to use SharedString in more places (#23813)

Splitting this off from
https://github.com/zed-industries/zed/pull/23808, per @maxdeviant's
suggestion!

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Richard Feldman 2025-01-28 19:04:21 -05:00 committed by GitHub
parent 92a1cb893f
commit 33d1145c3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 45 additions and 25 deletions

View file

@ -141,7 +141,7 @@ impl LanguageSelectorDelegate {
let need_icon = FileFinderSettings::get_global(cx).file_icons;
if let Some(buffer_language) = buffer_language {
let buffer_language_name = buffer_language.name();
if buffer_language_name.0.as_ref() == mat.string.as_str() {
if buffer_language_name.as_ref() == mat.string.as_str() {
label.push_str(" (current)");
let icon = need_icon
.then(|| self.language_icon(&buffer_language.config().matcher, cx))
@ -154,7 +154,7 @@ impl LanguageSelectorDelegate {
let language_name = LanguageName::new(mat.string.as_str());
match self
.language_registry
.available_language_for_name(&language_name.0)
.available_language_for_name(language_name.as_ref())
{
Some(available_language) => {
let icon = self.language_icon(available_language.matcher(), cx);