logoalt Hacker News

rhdjebejdbd • today at 5:17 PM • 1 reply • view on HN

Another comment said that returning a * was to avoid returning null which would crash users of the library who didn't check for null. That seems like a C smell to me


Replies

ethin • today at 6:19 PM

Not really. This is like if the char* were an Option<String> but you had programs which stupidly didn't check if the Option had something and assumed it always did. As others have said, Rust would not prevent this.

➕ show 1 reply