3 ms·
This request.params.get(&"userid".to_string()).as_slice() is rather ugly in comparison with Express's `req.params.userid` (or Sinatra's `params[:userid]`)
by bshimmin 12y ago
This
request.params.get(&"userid".to_string()).as_slice()
is rather ugly in comparison with Express's `req.params.userid` (or Sinatra's `params[:userid]`). Can something nicer be done here?
- cburgdorf 12y agoYeah, this cracks me up, too. I'm still learning the basics of Rust and so there is a high chance that it's just me being stupid. Strings are not just Strings in Rust land so there was plenty of room for me to fail :) I created a ticket to check all usage of Strings in the entire code base. You might want to track it for further progress on that. https://github.com/cburgdorf/Floor/issues/12 https://github.com/cburgdorf/Floor/issues/12
- kibwen 12y agoAt any given moment, there will exist at least one feature of Rust that is suffering temporary workarounds as a result of flux in the implementation. Strings are such a feature at the moment, and ugly code like the above is the interim solution. It will look nicer for 1.0. :)
- bshimmin 12y agoGreat: I wasn't sure if it was a feature of the framework or the language! Like many others here, I'm looking forward to playing with Rust in earnest once it's a little more mature.