hunter icon indicating copy to clipboard operation
hunter copied to clipboard

Remove dependencies to nightly build of rust compiler.

Open bhavitsharma opened this issue 4 years ago • 4 comments

Remove dependencies on nightly build of rust compiler. #89

  1. vec_remove_item
  2. std::options::NoneError Also, I formatted it using rustfmt, hence the reason for large amount of diff.

bhavitsharma avatar May 24 '20 01:05 bhavitsharma

Holy shit, that's awesome! Way to go!

But could you please remove the reformatting? It's not always a clear win. For example, I recently started aligning method calls like this:

    pub fn selected_file(&self) -> &File {
        let file = self.current_item
                       .as_ref()
                       .or_else(|| self.content.iter_files().nth(0))
                       .unwrap();
    }

I think that's more readable than what rustfmt does by default. There's a lot of custom-y formatting it removes that actually hurts readability. Maybe it can be configured in a way that keeps most of the aesthetics? I'll need to look into that. Depending on how much you're going to contribute in the future I'd be willing to compromise of course ;). In any case, it should be a separate commit...

rabite0 avatar May 24 '20 11:05 rabite0

maybe it can be configured in a way that keeps most of the aesthetics

Would you mind sharing the flags and custom settings of rust-fmt that you use so we can decide on a common environment? Also, can you create a discord server so we can chat easily? It's the preferred method these days. Even LLVM, Rust servers are the official way to chat over stuff.

bhavitsharma avatar May 24 '20 11:05 bhavitsharma

There are sadly still issues with rustfmt regarding method chains. Especially when let bindings are involved it just doesn't work as well as I'd like. So we're stuck with doing it manually and have to live with some inconsistency here, or there. Sometimes it's not even an accident, since readability is more important than consistent formatting IMO. What would be nice if there was a way to selectively enable some rustfmt stuff like import sorting, but I don't think there is...

rabite0 avatar May 24 '20 15:05 rabite0

sorry everyone for this mess, I had other commitments at my work. ~I will try to work on it this weekend~ (without any rustfmt). I made these changes and had format-on-save option turned on. Edit: I see someone already made a PR. Thanks!

bhavitsharma avatar Jun 11 '21 23:06 bhavitsharma