HN user

baysmith

1 karma
Posts0
Comments1
View on HN
No posts found.
Rust's Ugly Syntax 3 years ago

I think using . for both field/method access and name pathing would hurt readability and make name lookup more difficult. Perhaps replace :: with a backtick instead?

  use std;
  use std`fs`File;
  pub fn read<P: AsRef<Path>>(path: P) -> io`Result<Vec<u8>> {
    fn inner(path: &Path) -> io`Result<Vec<u8>> {
      let mut file = File`open(path)?;
      let mut bytes = Vec`new();
      file.read_to_end(&mut bytes)?;
      Ok(bytes)
    }
    inner(path.as_ref())
  }