mirror of
https://github.com/gnu4cn/rust-lang-zh_CN.git
synced 2026-08-22 06:03:27 +08:00
Updated 'src/error_handling/panic_or_not'.
This commit is contained in:
6
projects/panic_or_not/Cargo.toml
Normal file
6
projects/panic_or_not/Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "panic_or_not"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
9
projects/panic_or_not/src/main.rs
Normal file
9
projects/panic_or_not/src/main.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
use std::net::IpAddr;
|
||||
|
||||
fn main () {
|
||||
let home: IpAddr = "127.0.0.1"
|
||||
.parse()
|
||||
.expect("硬编码的 IP 地址应是有效的");
|
||||
|
||||
println! ("{:?}", home);
|
||||
}
|
||||
Reference in New Issue
Block a user