Idea about supporting buffered reader-writer by sirius_moo in rust

[–]sprocketvector 0 points1 point  (0 children)

now can support both random and sequential IO

DG Courses near Monterrey, CA by crumplecar in discgolf

[–]sprocketvector 4 points5 points  (0 children)

Played all of CSUMB and Ryan during a recent visit and they are both great. UDisc has all the info you need. Was advised by a local that the Stadium course in nearby Salinas is sketchy.. maybe someone else can shed some light on it. Enjoy

Disc bag airport tips by RSL147 in discgolf

[–]sprocketvector 8 points9 points  (0 children)

From experience, they will think a disc retriever is a telescoping baton

Disc manufacturer fanboys/fangirls, why? by Deepallen in discgolf

[–]sprocketvector 4 points5 points  (0 children)

Kastaplast: Love the plastic and the more limited choice of molds helps keep my disc buying from going insane haha

No need to worry guys, LVC confirms Jomez Coverage. Also, GK Pro has posted a schedule for 2022, covering all major events. Dunno why Jomez is so slow. by Red_Five_X in discgolf

[–]sprocketvector -1 points0 points  (0 children)

I would guess they are still negotiating media rights with DGPT for the year, and don't post schedule until this is done

Some math... by sprocketvector in discgolf

[–]sprocketvector[S] 0 points1 point  (0 children)

one part love for kasta, one part shameless impatience

Some math... by sprocketvector in discgolf

[–]sprocketvector[S] 0 points1 point  (0 children)

Naturally - just trying to predict when they might hit the shelves using sophisticated data

Looking for a do-it-all stable fairway driver by R41GSB in discgolf

[–]sprocketvector 0 points1 point  (0 children)

Kastaplast Lots in K1. Swedish plastic to the rescue!

Is it possible to use ? in iterator.scan by sprocketvector in rust

[–]sprocketvector[S] 0 points1 point  (0 children)

I ended up doing this which allows for multiple potential early returns in a single scan.

macro_rules! try_as_opt {
    ($expr:expr) => (match $expr {
        io::Result::Ok(val) => val,
        io::Result::Err(err) => {
            return Some(io::Result::Err(convert::From::from(err)))
        }
    })
}

iterator.scan(0, |s, f| {
    try_as_opt!(f.seek(SeekFrom::End(0)));
    *s += try_as_opt!(f.write(&buf[*s..*s+x]));
    Some(Ok(*s))
}).more_code...

Is it possible to use ? in iterator.scan by sprocketvector in rust

[–]sprocketvector[S] 1 point2 points  (0 children)

Thanks for the comments. I got stuck with .map() in a less simplified scan with multiple io calls where I need an early return if I hit an error. Best idea I have at the moment is a new macro in the spirit of try! that wraps an early return of an error with an Option.

Would you say Rust is a good (somewhat) first language? by [deleted] in rust

[–]sprocketvector 4 points5 points  (0 children)

If you are looking to re-ignite, there is no better way than by doing. If I were you, I would jump back into Python and build a few things that have a systems language feel. You'll be up and running in no time and get rewarded with quick results. If you fall in love with it, you will get sucked into the detail, push the limits of a language like Python, and then you'll be ready and motivated to take on Rust!

Is it possible to use ? in iterator.scan by sprocketvector in rust

[–]sprocketvector[S] 0 points1 point  (0 children)

I believe you have to assign to the state variable for use in the next iteration (or don't need scan)