lib: port to new rust