ids icon indicating copy to clipboard operation
ids copied to clipboard

Type mismatch in nanoid

Open phocks opened this issue 8 months ago • 1 comments

I think maybe the docs are just a bit off

It seems to return a string pub fn generate() -> String

But then the usage seems to expect a Result let assert Ok(id) = nanoid.generate()

https://hexdocs.pm/ids/ids/nanoid.html

error: Type mismatch
  ┌─ /Users/byrd.joshua/src/uuid/src/uuid.gleam:4:14
  │
4 │   let assert Ok(id) = nanoid.generate()
  │              ^^^^^^

Expected type:

    String

Found type:

    Result(a, b)

phocks avatar Jun 16 '25 23:06 phocks

oh weird, I'll fix this thanks.

rvcas avatar Jun 20 '25 03:06 rvcas