{"id":291515,"date":"2018-10-29T11:15:04","date_gmt":"2018-10-29T08:15:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=291515"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=291515","title":{"rendered":"\u0412\u044b\u043f\u0443\u0441\u043a Rust 1.30"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 Rust \u0440\u0430\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Rust: 1.30.0. Rust \u2014 \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Rust \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>rustup<\/code>, \u0442\u043e \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f Rust \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 1.30.0 \u0432\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ rustup update stable<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0449\u0435 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d <code>rustup<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/www.rust-lang.org\/install.html\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e<\/a> \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430. \u0421 <a href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1300-2018-10-25\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f\u043c\u0438 \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443 Rust 1.30.0<\/a> \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043d\u0430 GitHub.<\/p>\n<p>  <\/p>\n<h2 id=\"chto-voshlo-v-stabilnuyu-versiyu-1300\">\u0427\u0442\u043e \u0432\u043e\u0448\u043b\u043e \u0432 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e 1.30.0<\/h2>\n<p>  <\/p>\n<p>Rust 1.30 \u2014 \u0432\u044b\u0434\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432\u044b\u043f\u0443\u0441\u043a \u0441 \u0440\u044f\u0434\u043e\u043c \u0432\u0430\u0436\u043d\u044b\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439. \u041d\u043e \u0443\u0436\u0435 \u0432 \u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0431\u043b\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u043e\u0441\u044c\u0431\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0431\u0435\u0442\u0430-\u0432\u0435\u0440\u0441\u0438\u044e Rust 1.31, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u043c \u0440\u0435\u043b\u0438\u0437\u043e\u043c &#171;Rust 2018&#187;. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u044d\u0442\u043e\u043c \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 <a href=\"https:\/\/blog.rust-lang.org\/2018\/07\/27\/what-is-rust-2018.html\">&#171;What is Rust 2018&#187;<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"procedurnye-makrosy\">\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b<\/h3>\n<p>  <\/p>\n<p>\u0415\u0449\u0435 \u0432 <a href=\"https:\/\/blog.rust-lang.org\/2017\/02\/02\/Rust-1.15.html\">Rust 1.15<\/a> \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c &#171;\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 derive-\u043c\u0430\u043a\u0440\u043e\u0441\u044b&#187;. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>serde_derive<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#[derive(Serialize, Deserialize, Debug)] struct Pet {     name: String, }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>Pet<\/code> \u0432 JSON \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>serde_json<\/code>. \u042d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0443 \u0442\u0438\u043f\u0430\u0436\u0435\u0439 <code>Serialize<\/code> \u0438 <code>Deserialize<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0432 <code>serde_derive<\/code>.<\/p>\n<p>  <\/p>\n<p>Rust 1.30 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0435\u0449\u0435 \u0434\u0432\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u0430 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432: &#171;\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b&#187; \u0438 &#171;\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b&#187;.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u043f\u043e\u0434\u043e\u0431\u043d\u044b derive-\u043c\u0430\u043a\u0440\u043e\u0441\u0430\u043c \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>#[derive]<\/code>, \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043d\u043e\u0432\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u043c\u0438: derive-\u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043d\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0438 \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0432\u0430\u043c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <\/p>\n<pre><code>#[route(GET, \"\/\")] fn index() {<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>#[route]<\/code> \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0432 \u0441\u0430\u043c\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u043a\u0430\u043a \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441. \u0415\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code>#[proc_macro_attribute] pub fn route(attr: TokenStream, item: TokenStream) -&gt; TokenStream {<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0442\u0438\u043f\u0430 <code>TokenStream<\/code>: \u043f\u0435\u0440\u0432\u044b\u0439 \u2014 \u0434\u043b\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>GET, \"\/\"<\/code>. \u0412\u0442\u043e\u0440\u043e\u0439 \u2014 \u044d\u0442\u043e \u0442\u0435\u043b\u043e \u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u044d\u0442\u043e <code>fn index() {}<\/code> \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0430\u043a\u0440\u043e\u0441 <code>sql!<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">let sql = sql!(SELECT * FROM posts WHERE id=1);<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0430\u043a\u0440\u043e\u0441 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c SQL-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0438\u0445 \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code>#[proc_macro] pub fn sql(input: TokenStream) -&gt; TokenStream {<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 derive-\u043c\u0430\u043a\u0440\u043e\u0441\u0430: \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u043a\u0435\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043a\u043e\u0431\u043e\u043a, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e \u043d\u0438\u043c \u043a\u043e\u0434.<\/p>\n<p>  <\/p>\n<h3 id=\"makrosy-i-use\">\u041c\u0430\u043a\u0440\u043e\u0441\u044b \u0438 <code>use<\/code><\/h3>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/50911\/\">\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 use<\/a>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 <code>json<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>serde-json<\/code>, \u0440\u0430\u043d\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0437\u0430\u043f\u0438\u0441\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#[macro_use] extern crate serde_json;  let john = json!({     \"name\": \"John Doe\",     \"age\": 43,     \"phones\": [         \"+44 1234567\",         \"+44 2345678\"     ] });<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">extern crate serde_json;  use serde_json::json;  let john = json!({     \"name\": \"John Doe\",     \"age\": 43,     \"phones\": [         \"+44 1234567\",         \"+44 2345678\"     ] });<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u0430\u043a\u0440\u043e\u0441 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>macro_use<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d <a href=\"https:\/\/doc.rust-lang.org\/stable\/proc_macro\/\">\u043f\u0430\u043a\u0435\u0442 proc_macro<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0435\u0442 API, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432. \u0412 \u043d\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0438 API \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u0438 \u0442\u0430\u043a\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u043a\u0430\u043a <code>syn<\/code> \u0438 <code>quote<\/code> \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0435\u0433\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u043d\u044c\u0448\u0435:<\/p>\n<p>  <\/p>\n<pre><code>#[derive(Serialize)] struct Demo {     ok: String,     bad: std::thread::Thread, }<\/code><\/pre>\n<p>  <\/p>\n<p>\u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u0442\u0430\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435:<\/p>\n<p>  <\/p>\n<pre><code>error[E0277]: the trait bound `std::thread::Thread: _IMPL_SERIALIZE_FOR_Demo::_serde::Serialize` is not satisfied  --&gt; src\/main.rs:3:10   | 3 | #[derive(Serialize)]   |          ^^^^^^^^^ the trait `_IMPL_SERIALIZE_FOR_Demo::_serde::Serialize` is not implemented for `std::thread::Thread`<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code>error[E0277]: the trait bound `std::thread::Thread: serde::Serialize` is not satisfied  --&gt; src\/main.rs:7:5   | 7 |     bad: std::thread::Thread,   |     ^^^ the trait `serde::Serialize` is not implemented for `std::thread::Thread`<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"uluchshenie-sistemy-moduley\">\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h2>\n<p>  <\/p>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c \u0431\u043e\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u0432 Rust&#8217;\u0435; \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c \u0448\u0430\u0433\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043f\u0443\u0442\u0438 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u043c\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u0434\u043b\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432, \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>use<\/code>. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/54404\/\">\u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 prelude<\/a>, \u0442\u043e \u0435\u0441\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">\/\/ \u0431\u044b\u043b\u043e let json = ::serde_json::from_str(\"...\");  \/\/ \u0441\u0442\u0430\u043b\u043e let json = serde_json::from_str(\"...\");<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0432\u043e\u0445 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b \u043d\u0443\u0436\u0435\u043d \u0438\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439 Rust:<\/p>\n<p>  <\/p>\n<pre><code>extern crate serde_json;  fn main() {     \/\/ \u044d\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442; \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0430\u043a\u0435\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 `serde_json`     \/\/ \u0437\u0434\u0435\u0441\u044c \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438     let json = serde_json::from_str(\"...\"); }  mod foo {     fn bar() {         \/\/ \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442; \u043c\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d `foo`, \u0438 `serde_json`         \/\/ \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d         let json = serde_json::from_str(\"...\");      }      \/\/ \u043e\u0434\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 - \u044d\u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u044c \u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e `use`     use serde_json;      fn baz() {         \/\/ \u0434\u0440\u0443\u0433\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 - \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c `::serde_json`, \u043a\u043e\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f         \/\/ \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c, \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e         let json = ::serde_json::from_str(\"...\");     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u044b\u043b\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043b\u043e\u043c\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043f\u043e\u0434\u043c\u043e\u0434\u0443\u043b\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0443\u0442\u0438, \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 <code>extern crate<\/code>, \u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/54404\/\">use \u0441\u0442\u0430\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u043f\u0443\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043d\u0430 crate<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">mod foo {     pub fn bar() {         \/\/ ...     } }  \/\/ \u0431\u044b\u043b\u043e use ::foo::bar; \/\/ \u0438\u043b\u0438 use foo::bar;  \/\/ \u0441\u0442\u0430\u043b\u043e use crate::foo::bar;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <code>crate<\/code> \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0443\u0442\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0443\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043a\u043e\u0440\u043d\u044f \u043f\u0430\u043a\u0435\u0442\u0430. \u0420\u0430\u043d\u044c\u0448\u0435 \u043f\u0443\u0442\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 <code>use<\/code>, \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043d\u044f \u043f\u0430\u043a\u0435\u0442\u0430, \u043d\u043e \u043f\u0443\u0442\u0438 \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0432\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u043f\u0443\u0442\u0435\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">mod foo {     pub fn bar() {         \/\/ ...     } }  mod baz {     pub fn qux() {         \/\/ \u0431\u044b\u043b\u043e         ::foo::bar();         \/\/ \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 `use`:         \/\/ foo::bar();          \/\/ \u0441\u0442\u0430\u043b\u043e         crate::foo::bar();     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u0441\u0442\u0430\u043d\u0435\u0442 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0442\u043e \u043e\u043d, \u043c\u044b \u043d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u044f\u0441\u043d\u044b\u043c\u0438, \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0440\u043e\u0434\u043b\u0438\u0432\u044b\u0439 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 <code>::<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0442\u0438. \u0412 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u043f\u0443\u0442\u044c <code>a::b::c<\/code>, \u043a\u0440\u043e\u043c\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>use<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 <code>a<\/code> \u0438\u043c\u0435\u043d\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u0430? \u0422\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c <code>b::c<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e.<\/li>\n<li>\u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 <code>a<\/code> \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c <code>crate<\/code>? \u0422\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c <code>b::c<\/code> \u043e\u0442 \u043a\u043e\u0440\u043d\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430.<\/li>\n<li>\u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c <code>a::b::c<\/code> \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u0440\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0443\u0442\u0435\u0439 \u0432 <code>use<\/code>, \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043e\u0442 \u043a\u043e\u0440\u043d\u044f \u043f\u0430\u043a\u0435\u0442\u0430, \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e. \u041d\u043e \u043f\u0440\u0438 \u0435\u0434\u0438\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0438\u043b\u044c, \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043a \u043f\u0443\u0442\u044f\u043c \u043f\u043e\u0432\u0441\u044e\u0434\u0443 \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e, \u0438 \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0431 \u0438\u043c\u043f\u043e\u0440\u0442\u0430\u0445 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"syrye-identifikatory\">\u0421\u044b\u0440\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/53236\/\">\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u043a\u0430\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b<\/a>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">\/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c `for` let r#for = true;  \/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c `for` fn r#for() {     \/\/ ... }  \/\/ \u0432\u044b\u0437\u043e\u0432 \u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438  r#for();<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043a\u0430 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u044d\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f. \u041d\u043e \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u0432\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f Rust 2015 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0434\u043b\u044f Rust 2018 \u0438\u043b\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0442\u043e\u0433\u0434\u0430 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0443 \u043d\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u043c. \u041c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0435\u043c \u0430\u043d\u043e\u043d\u0441\u0435 Rust 2018.<\/p>\n<p>  <\/p>\n<h2 id=\"prilozheniya-bez-standartnoy-biblioteki\">\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h2>\n<p>  <\/p>\n<p>\u0415\u0449\u0435 \u0432 Rust 1.6 \u043c\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0438 \u043e <a href=\"https:\/\/blog.rust-lang.org\/2016\/01\/21\/Rust-1.6.html\">\u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 &#171;no_std&#187; \u0438 libcore<\/a> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0431\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441 \u043e\u0434\u043d\u0438\u043c \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u0435\u043c: \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u043e \u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 Rust 1.30 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/51366\/\"><code>#[panic_handler]<\/code><\/a> \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u043d\u0438\u043a\u0438. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<p>  <\/p>\n<h2 id=\"drugoe\">\u0414\u0440\u0443\u0433\u043e\u0435<\/h2>\n<p>  <\/p>\n<p>\u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435: \u0432 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u0445 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/53370\/\">\u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438<\/a>, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>pub<\/code>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 <code>vis<\/code>. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, &#171;\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b&#187;, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>#[rustfmt::skip]<\/code>, <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/53459\/\">\u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b<\/a>. \u041f\u0440\u0430\u0432\u0434\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 <em>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/em>, \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 <code>#[allow(clippy::something)]<\/code>, \u043e\u043d\u0438 \u0435\u0449\u0435 \u043d\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1300-2018-10-25\">\u0432 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f\u0445 \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"stabilizaciya-standartnoy-biblioteki\">\u0421\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0432\u044b\u043f\u0443\u0441\u043a\u0435 \u0431\u044b\u043b\u0438 <a href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#stabilized-apis\">\u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 API<\/a>:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>Ipv4Addr::{BROADCAST, LOCALHOST, UNSPECIFIED}<\/code><\/li>\n<li><code>Ipv6Addr::{BROADCAST, LOCALHOST, UNSPECIFIED}<\/code><\/li>\n<li><code>Iterator::find_map<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>trim_left<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e, \u0434\u043b\u044f RTL-\u044f\u0437\u044b\u043a\u043e\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#171;\u0441\u043f\u0440\u0430\u0432\u0430&#187; \u0438 &#171;\u0441\u043b\u0435\u0432\u0430&#187; \u0442\u0443\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0432\u0432\u043e\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>trim_left<\/code> -&gt; <code>trim_start<\/code><\/li>\n<li><code>trim_right<\/code> -&gt; <code>trim_end<\/code><\/li>\n<li><code>trim_left_matches<\/code> -&gt; <code>trim_start_matches<\/code><\/li>\n<li><code>trim_right_matches<\/code> -&gt; <code>trim_end_matches<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c\u0438 \u0441\u0442\u0430\u0440\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 (\u043d\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u043a\u043e\u043d\u0435\u0447\u043d\u043e) \u0432 Rust 1.33.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1300-2018-10-25\">\u0432 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f\u0445 \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"uluchsheniya-v-cargo\">\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0432 Cargo<\/h3>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 Cargo \u0432 \u044d\u0442\u043e\u043c \u0432\u044b\u043f\u0443\u0441\u043a\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c <a href=\"https:\/\/github.com\/rust-lang\/cargo\/pull\/5995\/\">\u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f!<\/a><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/84f\/4ce\/626\/84f4ce6263525deded821b6007735dec.gif\" alt=\"demo gif\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1300-2018-10-25\">\u0432 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f\u0445 \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443<\/a>.<\/p>\n<p>  <\/p>\n<h2 id=\"razrabotchiki-1300\">\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 1.30.0<\/h2>\n<p>  <\/p>\n<p>\u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043b\u044e\u0434\u0435\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u043e Rust 1.30. \u041c\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u0435\u0437 \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0432\u0430\u0441. <a href=\"https:\/\/thanks.rust-lang.org\/rust\/1.30.0\">\u0421\u043f\u0430\u0441\u0438\u0431\u043e!<\/a><\/p>\n<p>  <\/p>\n<p><em>\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u0432\u044b\u0440\u0430\u0436\u0430\u044e \u043e\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 Rustycrate \u0438 \u043b\u0438\u0447\u043d\u043e <a href=\"https:\/\/habr.com\/users\/vitvakatu\/\" class=\"user_link\">vitvakatu<\/a> \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0438 \u0432\u044b\u0447\u0438\u0442\u043a\u043e\u0439<\/em><\/p>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/428073\/\"> https:\/\/habr.com\/post\/428073\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 Rust \u0440\u0430\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Rust: 1.30.0. Rust \u2014 \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Rust \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>rustup<\/code>, \u0442\u043e \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f Rust \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 1.30.0 \u0432\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ rustup update stable<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0449\u0435 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d <code>rustup<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/www.rust-lang.org\/install.html\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e<\/a> \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430. \u0421 <a href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1300-2018-10-25\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f\u043c\u0438 \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443 Rust 1.30.0<\/a> \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043d\u0430 GitHub.<\/p>\n<p>  <\/p>\n<h2 id=\"chto-voshlo-v-stabilnuyu-versiyu-1300\">\u0427\u0442\u043e \u0432\u043e\u0448\u043b\u043e \u0432 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e 1.30.0<\/h2>\n<p>  <\/p>\n<p>Rust 1.30 \u2014 \u0432\u044b\u0434\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432\u044b\u043f\u0443\u0441\u043a \u0441 \u0440\u044f\u0434\u043e\u043c \u0432\u0430\u0436\u043d\u044b\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439. \u041d\u043e \u0443\u0436\u0435 \u0432 \u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0431\u043b\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u043e\u0441\u044c\u0431\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0431\u0435\u0442\u0430-\u0432\u0435\u0440\u0441\u0438\u044e Rust 1.31, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u043c \u0440\u0435\u043b\u0438\u0437\u043e\u043c &#171;Rust 2018&#187;. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u044d\u0442\u043e\u043c \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 <a href=\"https:\/\/blog.rust-lang.org\/2018\/07\/27\/what-is-rust-2018.html\">&#171;What is Rust 2018&#187;<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"procedurnye-makrosy\">\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b<\/h3>\n<p>  <\/p>\n<p>\u0415\u0449\u0435 \u0432 <a href=\"https:\/\/blog.rust-lang.org\/2017\/02\/02\/Rust-1.15.html\">Rust 1.15<\/a> \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c &#171;\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 derive-\u043c\u0430\u043a\u0440\u043e\u0441\u044b&#187;. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>serde_derive<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#[derive(Serialize, Deserialize, Debug)] struct Pet {     name: String, }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>Pet<\/code> \u0432 JSON \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>serde_json<\/code>. \u042d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0443 \u0442\u0438\u043f\u0430\u0436\u0435\u0439 <code>Serialize<\/code> \u0438 <code>Deserialize<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0432 <code>serde_derive<\/code>.<\/p>\n<p>  <\/p>\n<p>Rust 1.30 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0435\u0449\u0435 \u0434\u0432\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u0430 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432: &#171;\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b&#187; \u0438 &#171;\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b&#187;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-291515","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=291515"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291515\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}