DEV Community

Cover image for add one

add one

o2sh on November 06, 2018

Here is a little program I wrote in Rust that allows you to add one to any number o2sh / add-one ...
Collapse
 
tux0r profile image
tux0r

Why is such a thing needed? Can't Rust do that yet?

(I would like to point out that this sounds a lot like Node-ism: npm has multiple (!) packages for "noop"...)

Collapse
 
o2sh profile image
o2sh

It's a different approach without the limitations. Indeed, the input is not bound to a type (i32, i64...) and can be very big.

It may also be faster...

Collapse
 
vberlier profile image
Valentin Berlier

Right so your entire function would run faster than what effectively compiles to a single CPU instruction... 🤔

Collapse
 
nektro profile image
Meghan (she/her)