refactor: using slices.Contains to simplify the code

Signed-off-by: NinaLua <iturf@sina.cn>
This commit is contained in:
NinaLua
2025-03-07 16:46:36 +08:00
committed by Michael Mayer
parent 2440c5424d
commit b3ad0e5b92

View File

@@ -2,6 +2,8 @@
package duf
import "slices"
func isFuseFs(m Mount) bool {
//FIXME: implement
return false
@@ -10,25 +12,13 @@ func isFuseFs(m Mount) bool {
func isNetworkFs(m Mount) bool {
fs := []string{"nfs", "smbfs"}
for _, v := range fs {
if m.Fstype == v {
return true
}
}
return false
return slices.Contains(fs, m.Fstype)
}
func isSpecialFs(m Mount) bool {
fs := []string{"devfs", "tmpfs", "linprocfs", "linsysfs", "fdescfs", "procfs"}
for _, v := range fs {
if m.Fstype == v {
return true
}
}
return false
return slices.Contains(fs, m.Fstype)
}
func isHiddenFs(m Mount) bool {