It seems that “extern crate time;” aborts again.
Has there been any changes in here or I made some mistakes?
I got this error when I trying to use the ‘rand’
error[E0463]: can't find crate for `rand`
--> /tmp/Answer.rs:6:1
|
6 | extern crate rand;
| ^^^^^^^^^^^^^^^^^^ can't find crate
error: aborting due to previous error
Oh no . We’ve upgraded Rust recently… Sorry for the inconvenience! I didn’t see your message until now, I’ll have a look to it tomorrow.
Thank you
Thanks for the quick solution!
Hello,
Could it be possible to update the FAQ in order to add the information that rand and time are available ?
Would you be willing to also add the itertools
crate? It provides functionality similar to itertools in Python and really helps with some basic things. For example in Python you can split a string s
(for example the input string) as follows:
a, b, c, d = s.split()
With itertools
in Rust, you can write something similar.
use itertools::Itertools;
let (a, b, c, d) = s.split_whitespace().next_tuple.unwrap();
(Although, I can think of other ways to code this example as well without the crate, so it is not the end of the world if it can’t be added.)
@_CG_Maxime I do have this error again while using crate rand perhaps due to the recent langage update:
error[E0463]: can't find crate for `rand`
--> /tmp/Answer.rs:1:1
|
1 | extern crate rand;
| ^^^^^^^^^^^^^^^^^^ can't find crate
error: aborting due to previous error
Could you fix it please?
Thx
Guillaume
Hello,
This is fixed. Please check this is working as expected now.
Lo,
It works many thanks
Is there any way to know what crates are available for us to use? rand and time are great. Anything else?
Would it be possible to add lazy_static? IMO this is basic functionality as C++ and Java have it built in.
available in the faq (/faq)
about lazy_static, I don’t know. I’ll check.
I think time
is not needed any more. The original proposal was from before the release of Rust 1.8.0, which introduced std::time::Instant
and std::time::SystemTime
.
I agree that lazy_static
would be quite useful to introduce.
And everything else should be updated. I have recently had to work around a couple functions (such as Iterator::step_by
) not yet existing in 1.27.