mirror of
https://github.com/photoprism/photoprism.git
synced 2025-09-26 21:01:58 +08:00
refactor: using slices.Contains to simplify the code
Signed-off-by: NinaLua <iturf@sina.cn>
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user