PotatoesFall@discuss.tchncs.de to Programmer Humor@programming.dev · 4 months agoThe easiest problemdiscuss.tchncs.deimagemessage-square103fedilinkarrow-up1638arrow-down116file-text
arrow-up1622arrow-down1imageThe easiest problemdiscuss.tchncs.dePotatoesFall@discuss.tchncs.de to Programmer Humor@programming.dev · 4 months agomessage-square103fedilinkfile-text
minus-squarePoolloverNathan@programming.devlinkfedilinkarrow-up3·4 months agoI present to you quality variable names. (and a Mount Rustmore) (Reconfigure(f), 'c') => { let mut p: Vec<&str> = vec![]; loop { match args.next() { Some(k) => { if k == "=" { match args.next() { None => q("need value for Rc"), Some(v) => u( f, |f| Box::new( |c| { f(c); c.set(p.iter().copied(), v); for e in p { unsafe { Box::<str>::from_raw( std::mem::transmute(e) ); } } } ) ) }; break } else { p.push(Box::leak(k.into())); } } None => error("need path element or = for Rc"), } } },
minus-squarePoolloverNathan@programming.devlinkfedilinkarrow-up2·4 months agoArgument parsing; turning Rc foo = bar into Reconfigure(|c| c.foo = "bar").
I present to you quality variable names. (and a Mount Rustmore)
what is this for ?
Argument parsing; turning
Rc
foo
=
bar
intoReconfigure(|c| c.foo = "bar")
.