Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
roblabla
· 6y ago · 0 comments
A string works. If a numerical/in-place representation is wanted for efficiency, you could rely on the fact that stock symbols are always less than 8 characters, so we can parse it into an array of 8 bytes.
Comments
[–]
_fbpt
6y ago
Is wrapping a String in a semi-opaque newtype (or a type alias at least) good to encode the semantic meaning of the string type?
[–]
usefulcat
6y ago
Actually they are definitely not always <= 8 characters, but usually they are.