<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>第2章 原生类型 on 编程那些事儿</title><link>https://before80.github.io/prgms/Rust/RustByExample/primitives/</link><description>Recent content in 第2章 原生类型 on 编程那些事儿</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Fri, 21 Aug 2026 22:34:20 +0800</lastBuildDate><atom:link href="https://before80.github.io/prgms/Rust/RustByExample/primitives/index.xml" rel="self" type="application/rss+xml"/><item><title>01-字面量和运算符</title><link>https://before80.github.io/prgms/Rust/RustByExample/primitives/01-literals/</link><pubDate>Thu, 20 Aug 2026 21:20:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/RustByExample/primitives/01-literals/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://doc.rust-lang.org/stable/rust-by-example/"&gt;Rust By Example&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://doc.rust-lang.org/stable/rust-by-example/primitives/literals.html"&gt;https://doc.rust-lang.org/stable/rust-by-example/primitives/literals.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="字面量和运算符"&gt;字面量和运算符&lt;/h1&gt;
&lt;p&gt;整数 &lt;code&gt;1&lt;/code&gt;、浮点数 &lt;code&gt;1.2&lt;/code&gt;、字符 &lt;code&gt;'a'&lt;/code&gt;、字符串 &lt;code&gt;&amp;quot;abc&amp;quot;&lt;/code&gt;、布尔值 &lt;code&gt;true&lt;/code&gt; 和单元类型 &lt;code&gt;()&lt;/code&gt; 可以用数字、文字或符号之类的 “字面量”（literal）来表示。&lt;/p&gt;</description></item><item><title>02-元组</title><link>https://before80.github.io/prgms/Rust/RustByExample/primitives/02-tuples/</link><pubDate>Thu, 20 Aug 2026 21:20:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/RustByExample/primitives/02-tuples/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://doc.rust-lang.org/stable/rust-by-example/"&gt;Rust By Example&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://doc.rust-lang.org/stable/rust-by-example/primitives/tuples.html"&gt;https://doc.rust-lang.org/stable/rust-by-example/primitives/tuples.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="元组"&gt;元组&lt;/h1&gt;
&lt;p&gt;元组是一个可以包含各种类型值的组合。元组使用括号 &lt;code&gt;()&lt;/code&gt; 来构造（construct），而每个元组自身又是一个类型标记为 &lt;code&gt;(T1, T2, ...)&lt;/code&gt; 的值，其中 &lt;code&gt;T1&lt;/code&gt;、&lt;code&gt;T2&lt;/code&gt; 是每个元素的类型。函数可以使用元组来返回多个值，因为元组可以拥有任意多个值。&lt;/p&gt;</description></item><item><title>03-数组和切片</title><link>https://before80.github.io/prgms/Rust/RustByExample/primitives/03-array/</link><pubDate>Thu, 20 Aug 2026 21:20:00 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/RustByExample/primitives/03-array/</guid><description>&lt;blockquote&gt;
&lt;p&gt;译文 · 基于 &lt;a href="https://doc.rust-lang.org/stable/rust-by-example/"&gt;Rust By Example&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://doc.rust-lang.org/stable/rust-by-example/primitives/array.html"&gt;https://doc.rust-lang.org/stable/rust-by-example/primitives/array.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="数组和切片"&gt;数组和切片&lt;/h1&gt;
&lt;p&gt;数组（array）是一组拥有相同类型 &lt;code&gt;T&lt;/code&gt; 的对象的集合，在内存中是连续存储的。数组使用中括号 &lt;code&gt;[]&lt;/code&gt; 来创建，且它们的大小在编译时会被确定。数组的类型标记为 &lt;code&gt;[T; length]&lt;/code&gt;（译注：&lt;code&gt;T&lt;/code&gt; 为元素类型，&lt;code&gt;length&lt;/code&gt; 表示数组大小）。&lt;/p&gt;</description></item></channel></rss>