lib: port to new rust (broken)