Renaming a box with a hyphen no longer compiles

This no longer compiles:

extern crate "my-crate" as my_crate1; 

What is the new syntax? I did not find anything by doing a search.

+6
source share
1 answer

Gums in extern box names can be replaced with underscores. Therefore your example should be

 extern crate my_crate as my_crate1; 

Or, if you want to underline the name, use the following:

 extern crate my_crate; 
+5
source

Source: https://habr.com/ru/post/989435/


All Articles