Use llvm::Optional<uint16_t> instead of int for port number
in UriParser::Parse(), and use llvm::None to indicate missing port
instead of a magic value of -1.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Seems like a (slight) improvement. You don't have to do this, but what I think would best help here is if we made a struct for these parsed results:
struct URI { static Optional<URI> parse(StringRef); StringRef scheme; ... }
throw in an operator== and << and even the unit tests would become nicer.