Updated 'src/error_handling/panic_or_not'.

This commit is contained in:
Hector PENG
2025-06-30 16:46:31 +08:00
parent 1bf76c5f70
commit 1a8cac0ab5
4 changed files with 34 additions and 20 deletions

View File

@@ -0,0 +1,6 @@
[package]
name = "panic_or_not"
version = "0.1.0"
edition = "2024"
[dependencies]

View File

@@ -0,0 +1,9 @@
use std::net::IpAddr;
fn main () {
let home: IpAddr = "127.0.0.1"
.parse()
.expect("硬编码的 IP 地址应是有效的");
println! ("{:?}", home);
}