this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

pkg/uuid: remove ToString

The function was added with the introduction of pkg/uuid back in 2021,
but it has never done anything useful; it takes a string and returns
the same string, entirely unchanged and without any side effect.

A search on github.com for `uuid tostring language:cue` returns zero
results, even though there are >100 hits for CUE files importing "uuid",
which makes sense given that the function does nothing useful.

One possible answer could have been symmetry with ToInt,
however there's also FromInt and yet no FromString.
Another possibility would have been as a parser or validator of UUIDs,
but that's what Parse and Valid already do.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Iaf671c1a5054962fb584295196de4a2797613200
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1213297
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

-19
-12
pkg/uuid/pkg.go
··· 39 39 } 40 40 }, 41 41 }, { 42 - Name: "ToString", 43 - Params: []pkg.Param{ 44 - {Kind: adt.StringKind}, 45 - }, 46 - Result: adt.StringKind, 47 - Func: func(c *pkg.CallCtxt) { 48 - x := c.String(0) 49 - if c.Do() { 50 - c.Ret = ToString(x) 51 - } 52 - }, 53 - }, { 54 42 Name: "URN", 55 43 Params: []pkg.Param{ 56 44 {Kind: adt.StringKind},
-7
pkg/uuid/uuid.go
··· 38 38 return x.String(), err 39 39 } 40 40 41 - // TODO(mvdan): what is ToString meant to do? it appears like a no-op? 42 - 43 - // String represents a 128-bit UUID value as a string. 44 - func ToString(x string) string { 45 - return x 46 - } 47 - 48 41 // URN reports the canonical URN of a UUID. 49 42 func URN(x string) (string, error) { 50 43 u, err := uuid.Parse(x)