Stuck with borrowing

⚓ Rust    📅 2026-02-16    👤 surdeus    👁️ 2      

surdeus

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Stuck with borrowing

I get Error 0505 on this snip:

		let ps0 = expand(ps[0]);
		let ps1 = expand(ps[1]);
		println!("The product of {:?} and {:?} is {:?}",
			ps0, ps1, product(ps0, ps1))

All variables are of type Vec<u8>.
The function product does NOT change its arguments, and the compiler should know that. Still, this does not compile. What do I do wrong?

1 post - 1 participant

Read full topic

🏷️ Rust_feed