Great! You removed the invalid lifetimes on temporary references, so I'd say you did solve the problem.
PS. Since you know C you may be interested in this recent book:
https://rust-for-c-programmers.com/
It's been discussed here:
https://users.rust-lang.org/t/introduction-to-rust-for-c-programmers/119965