Avatar

Ogeon

Ogeon@programming.dev
Joined
1 posts • 7 comments
Direct message

Option<T> has a From<T> implementation that lets you write Option::from($file_path).map(|path| path.to_string()) to accept both cases in the same expression.

https://doc.rust-lang.org/std/option/enum.Option.html#impl-From<T>-for-Option<T>

permalink
report
reply

Det är ändå redan för sent. Det är buskens hus nu.

permalink
report
parent
reply

That’s silly. Luckily, I don’t think this was the same situation. This was at a university and they had classes with other languages. The beginner classes were split into two variants, where some students (mostly CS students) learned C, and other students (economy, etc.) learned Python. I suppose they figured it was more useful to them or something.

permalink
report
parent
reply

That’s definitely part of “the deal” with MIT and Apache. The other end of it is that they shouldn’t really expect to get anything more than what the authors are willing to give.

permalink
report
parent
reply

Reject C, return to assembly. Structured programming is the true oppression our generation never talks about.

permalink
report
reply

I was a teacher’s assistant in beginner’s programming at university for a bit. I expected them to learn C, which I knew enough of, but I got assigned to a group that learned Python instead. I had never used Python at the time. I ended up having to speed learn it while trying to teach it, to not be completely useless.

permalink
report
reply