Closed yangtau closed 2 years ago
Since the mask is recursive an empty mask assumes that everything should be copied.
Consider the following mask: a{b{d}, c}
.
If the fielda.c
is a struct then it is expected that the entire struct is copied whereas for the field a.b
only the field d
should be copied.
If you don't want this behavior for the root mask you should check if the mask is empty before calling StructToStruct
.
I am confused with the copy result. When the mask (paths) is empty, what I expect is nothing will be copied. But the result is everything is copied.
I am wondering what's the purpose to copy everything when the mask is empty?