I've gotten used to duckduckgo for even basic things for the first few hours after picking up a language I didn't use for a while. Here are some examples of things I searched for: "rust join two iterables", "rust impl sum", "rust tokio select macro", "rust impl bitand for bool", "rust convert pathbuf to path", "rust join paths", "rust check if file exists", "rust tuple windows", "rust rand gen_range", "rust generate n random numbers", "rust system exit".
Then there are the small differences where trial-and-errors + immediate IDE feedback give me the answer. For example, is it 'len(foo)' or 'foo.len()?' Is it 'int foo' or 'foo: int'? Is it 'let foo = ...' or just 'foo = ...'?
The more you code, the better you get at 1) adapting faster, 2) accepting that you need to "land". "Landing" can take hours or days, if you measure by how simple things you have to search for.
Your two concrete examples are "dangerous syntax"; another one (although not language-specific) is forgetting to close a parenthesis: They're the kind of errors that give poor error messages in many languages, and so take unproportionally long to debug considering how banal the mistake is. I think that over time, you learn to be more careful in the places where you've wasted the most time.