[#1770] fstree: Depth parameter int -> uint64

Negative values have no sense. On the other hand it differs from the
blobovnicza's configuration and prevents unification.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-09-26 19:38:03 +03:00 committed by fyrchik
parent 4aa4694152
commit 5c69e19016
3 changed files with 7 additions and 7 deletions

View file

@ -26,14 +26,14 @@ func (x *Config) Type() string {
//
// Returns DepthDefault if the value is out of
// [1:fstree.MaxDepth] range.
func (x *Config) Depth() int {
d := config.IntSafe(
func (x *Config) Depth() uint64 {
d := config.UintSafe(
(*config.Config)(x),
"depth",
)
if d >= 1 && d <= fstree.MaxDepth {
return int(d)
return d
}
return DepthDefault