用Rust写小程序“Hello,world!“

Hello,World!
Now that you’ve installed Rust,it’s time to write your first Rust program.(现在你已经安装了Rust,是写你的第一个Rust程序的时候了。)It’s traditional when learning a new language to write a little program that prints the text Hello,world! To the screen,so we’ll do the same here.(学习一门新语言写一个小程序打印Hello,world!到屏幕是惯例。那么在这里我们也同样这么做。)
Note:This book assumes basic familiarity with the command line.(注意:本书假定基本熟悉命令行。)Rust makes no specific demands about your editing or tooling or where your code lives,so if you prefer to use an integrated development environment(IDE) instead of the command line,feel free to use your favorite IDE.(Rust对你的编辑或工具或你把代码放在哪里没有特别的要求,因此假如你更喜欢用集成开发环境代替命令行,随便你使用你更喜欢的IDE。)Many IDEs now have some degree of Rust support;check the IDE’s documentation for details. (许多IDEs有一些支持度;细节请查看IDE的文档。)The Rust team has been focusing on enabling great IDE support via rust-analyzer. (Rust团队已经由Rust分析器集中精力于能获得巨大的 IDE支持。)See APPENDIX D for more details.(看附录D以得到细节。)
Creating a Project Directory(创建一个项目目录)
You’ll start by making a directory to store your Rust code.(你将从创建一个存储你的Rust代码的目录开始。)It doesn’t matter to Rust where your code lives,(对于Rust来说你的代码在哪不重要,)but for the exercises and projects in this book,(但是对于练习及这本书中的项目而言,)we suggest making a projects directory in your home directory and keeping all your project there.(我们建议你在你的家目录创建一个项目目录并且在那里保存你的项目。)
Open a terminal and enter the following commands to make a projects directory and a directory for the “Hello,world!”project within the projects directory.(打开一个终端并输入下面的命令创建一个项目目录以及在项目目录中创建一个“Hello,world!”项目的目录。)
For Linux,macOS,and PowerShell on windows,enter this:(对于Linux、macOS, 及在windows的PowerShell,输入:)
$ mkdir ~/projects
$ cd ~/projects
$ mkdir hello_world
$ cd hello_world
For Windows CMD,enter this:(对于Windows CMD,输入:)

mkdir “%USERPROFILE%\projects”
cd /d “%USERPROFILE%\projects”
mkdir hello_worl

你可能感兴趣的:(rust,小程序,开发语言)