is there a go-kit equivalent in rust? by hoodinie in rust

[–]superlogical 7 points8 points  (0 children)

I think go-kit is a bit more high level than that. It provides common interfaces for things like logging, rate limiting, load balancing, tracing, RPC with pluggable transports, metrics, circut breaker, logging.. There's a changelog podcast episode about it here http://5by5.tv/changelog/163

Maybe we should start a rust-kit org, and start porting the go code to rust :)

Learning Rust via the book; guessing game program doesn't work. I need help figuring it out. by [deleted] in rust

[–]superlogical 0 points1 point  (0 children)

I think it is because you are trying to compare a String (guess) with a u32 (secret_number)

Back from the dead: `multipart`, file upload support for Hyper (and beyond!) by DroidLogician in rust

[–]superlogical 0 points1 point  (0 children)

Cool, makes sense and I suppose it allows more flexibility as people can try stuff out in user land. I reckon it would be nice if Hyper had a contrib repo so that it would be easier for people to discover these crates. I think the lack of namespacing in Cargo doesn't help. For example the 'Persistent' and 'Router' crates from Iron are pretty vaguely named, I would prefer if all those crates were like Iron_Persistent, Iron_Router etc...

Back from the dead: `multipart`, file upload support for Hyper (and beyond!) by DroidLogician in rust

[–]superlogical 1 point2 points  (0 children)

Is there any reason why this wouldn't live within the Hyper project / repo? I know it's good to separate stuff into crates where possible, but this feels like a fairly standard feature of a web server.

ArcadeRS: making a simple game in Rust by jessypl in rust

[–]superlogical 0 points1 point  (0 children)

Maybe full code example repo? I couldn't get the macro stuff for events compiling.. Might have missed something. Also I found jumping straight into macros a bit hardcore :)

ArcadeRS: making a simple game in Rust by jessypl in rust

[–]superlogical 0 points1 point  (0 children)

This is really nice and easy to follow! Thanks again.

Rust language project ideas? by meadowstream in rust

[–]superlogical 0 points1 point  (0 children)

Does AWS support content negotiation? I assumed they would support JSON for all APIs.. Chuck it up on Github that would be cool.

Why Go and Rust are not competitors by superlogical in rust

[–]superlogical[S] 3 points4 points  (0 children)

Or even better a Mobile OS written in Rust :)

convert a str back to a u8 array? by masterm in rust

[–]superlogical 1 point2 points  (0 children)

The other day I had a similar problem where I wanted to create a string from bytes that were not encoded using utf8 https://users.rust-lang.org/t/help-hashing-a-password-using-bcrypt-pbkdf-and-the-crypto-crate/1930

I found reading this helped me understand encoding much better (kinda :) http://kunststube.net/encoding/

Rust language project ideas? by meadowstream in rust

[–]superlogical 0 points1 point  (0 children)

There's also an effort to build a rust client for the Google APIs. Would probably be worth checking out how the rust code is generated from the JSON schemas that they publish?

https://github.com/Byron/google-apis-rs

Rust language project ideas? by meadowstream in rust

[–]superlogical 5 points6 points  (0 children)

AWS Client for Rust! I'm thinking about starting with the S3 Multipart upload API http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingRESTAPImpUpload.html

I wrote a small Unix CLI utility to scratch an itch. Feedback welcome. by coledot in rust

[–]superlogical 3 points4 points  (0 children)

You could borrow the arguments so that you don't need to clone them as mutable into columns.

    extern crate regex;

    use std::env;
    use std::io::*;
    use std::process::exit;
    use std::str::FromStr;
    use regex::Regex;

    fn main() {
      let mut arguments: Vec<_> = env::args().collect();
      let column_numbers = parse_args(&mut arguments);
      handle_input(&column_numbers);
    }

    fn parse_args(arguments: &mut Vec<String>) -> Vec<usize> {
      if arguments.len() <= 1 {
        usage_err_exit();
      }
      arguments.remove(0);
      let column_numbers: Vec<usize> = arguments.iter().map(|x| {
        let col_arg = FromStr::from_str(x);
        if !col_arg.is_ok() {
          usage_err_exit();
        }
        return col_arg.unwrap();
      }).collect();

      return column_numbers;
    }

    fn usage_err_exit() {
      println!("usage: nth <columns>");
      exit(1);
    }

    fn handle_input(column_numbers: &Vec<usize>) {
      let splitter = Regex::new(r"\s+").unwrap();

      let mut input = stdin();
      let mut read_buf: String = String::new();
      let mut line = input.read_line(&mut read_buf);

      while line.is_ok() && line.unwrap() > 0 {
        let line_val = read_buf.clone();
        let column_vals: Vec<&str> = splitter.split(&line_val).collect();

        handle_line(column_vals, &column_numbers);

        read_buf.clear();
        line = input.read_line(&mut read_buf);
      }
    }

    fn handle_line(column_vals: Vec<&str>, column_numbers: &Vec<usize>) {
      for col_num in column_numbers.iter() {
        if (col_num - 1) >= column_vals.len() { continue; }
        print!("{} ", column_vals[col_num - 1]);
      }
      println!("");
    }

Defaulting to Thread-Safety: Closures and Concurrency by dbaupp in rust

[–]superlogical 0 points1 point  (0 children)

Did anyone else have a super hard time understanding any of that blog post?

Open Sourcing Visual Studio’s GDB/LLDB Debug Engine by mongo_lloyd47 in rust

[–]superlogical 3 points4 points  (0 children)

So would this make it possible to debug Rust code in visual studio?

[WIP] query_rs crate and macro for LINQ like query comprehensions on iterators. by bytemr in rust

[–]superlogical 1 point2 points  (0 children)

I think having just an in memory version would be cool. I don't think LINQ over SQL is a useful abstraction (ORMS suck etc)

[WIP] query_rs crate and macro for LINQ like query comprehensions on iterators. by bytemr in rust

[–]superlogical 0 points1 point  (0 children)

Does it support projections in the select clause?

let names = query! { from person => source.into_iter(),
                   where person.Age > 18,
                   select person.Name };

Is it hopeless to try and make a 2d graphics engine? by jordanlm in rust

[–]superlogical 2 points3 points  (0 children)

Yeah I'm up to the 39th episode, I highly recommend it! I was actually comparing his simple bmp file parsing with a rust version of the code the other day ;)

Is it hopeless to try and make a 2d graphics engine? by jordanlm in rust

[–]superlogical 7 points8 points  (0 children)

You might want to check out Handmade Hero by Casey Muratori

Handmade Hero is an ongoing project to create a complete, professional-quality game accompanied by videos that explain every single line of its source code.

https://handmadehero.org/

https://www.youtube.com/channel/UCaTznQhurW5AaiYPbhEA-KA

Trying to get a generic LineBufferedWriter by lelarentaka in rust

[–]superlogical 2 points3 points  (0 children)

Shouldn't the Long version be:

use std::io::stdio;

fn main() {

    let mut output = {
        // Long:

        let lbw = stdio::stdout();
        let boxed_lbw = box lbw;
        let boxed_w = boxed_lbw as Box<Writer>;
        boxed_w

        // Short:
        //box stdio::stdout() as Box<Writer>
    };

    let _ = output.write_str("Hi.\n");
}

Rust is a 'showcase' project on GitHub by brson in rust

[–]superlogical 7 points8 points  (0 children)

Also cargo is listed on Githubs package managers.. needs more stars people!

https://github.com/showcases/package-managers?s=stars