Inline unnecessary is_symlink variable

This commit is contained in:
Yash Thakur 2025-03-07 19:50:17 -05:00 committed by GitHub
parent 5f20b723a8
commit 092e210412
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,11 +66,10 @@ fn complete_rec(
for entry in result.filter_map(|e| e.ok()) {
let entry_name = entry.file_name().to_string_lossy().into_owned();
let entry_isdir = entry.path().is_dir();
let is_symlink = entry.path().is_symlink();
let mut built = built.clone();
built.parts.push(entry_name.clone());
// Symlinks to directories shouldn't have a trailing slash (#13275)
built.isdir = entry_isdir && !is_symlink;
built.isdir = entry_isdir && !entry.path().is_symlink();
if !want_directory || entry_isdir {
matcher.add(entry_name.clone(), (entry_name, built));