mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Simplify convertible check - same type is OK
This is to clarify the code. No actual effect at the moment, but I manually verified this in the case of identical types.
This commit is contained in:
parent
ed59210f04
commit
7fa1e87d66
@ -309,6 +309,9 @@ func isDirectlyConvertible(in, out *types.Type, manualConversions conversionFunc
|
||||
return isConvertible(in, out.Underlying, manualConversions)
|
||||
}
|
||||
|
||||
if in == out {
|
||||
return true
|
||||
}
|
||||
if in.Kind != out.Kind {
|
||||
return false
|
||||
}
|
||||
@ -318,12 +321,6 @@ func isDirectlyConvertible(in, out *types.Type, manualConversions conversionFunc
|
||||
// We don't support conversion of other types yet.
|
||||
return false
|
||||
}
|
||||
switch out.Kind {
|
||||
case types.Builtin, types.Struct, types.Map, types.Slice, types.Pointer:
|
||||
default:
|
||||
// We don't support conversion of other types yet.
|
||||
return false
|
||||
}
|
||||
|
||||
switch in.Kind {
|
||||
case types.Builtin:
|
||||
|
Loading…
Reference in New Issue
Block a user