Hi, I have an important question. We need import some traits for activating some functions. Let me explain the situation with an example. Let us look that code:
let result = sqlx::query("SELECT * FROM users").fetch_all(&pool).await?;
let result = result
.iter()
.enumerate()
.map(|(index, row)| {
// In here I'm getting error because I didn't import `sqlx::Row` crate on the top
let id: i32 = row.get(0);
id
})
.collect::<Vec<i32>>();
When I add use sqlx::Row; myself on the top than I can use get() function. So my question is that: why rust-analyzer doesn't suggest the correct trait. Isn't it possible finding the correct trait? Thanks.
Hi, I have an important question. We need import some traits for activating some functions. Let me explain the situation with an example. Let us look that code:
When I add
use sqlx::Row;
myself on the top than I can useget()
function. So my question is that: why rust-analyzer doesn't suggest the correct trait. Isn't it possible finding the correct trait? Thanks.