Skip to content

Commit ba977cd

Browse files
committed
fix documentation comment & remove unnecessary Result wrapping
1 parent e13d8d9 commit ba977cd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

chapter3/src/3_6_2/main.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
/// Rust には scanf 関数はない。したがって、この節は本来は実装できない。
2-
/// Rust のマクロを使用すると scanf に近い実装を作ることができるので、参考程度に実装しておく。
3-
/// マクロを自前実装する以外の選択肢としては、下記のようなクレートを使用する手もある。
4-
/// - [text_io](https://github.com/oli-obk/rust-si): scan マクロが存在する。
5-
/// - [scan_fmt](https://github.com/wlentz/scan_fmt): 同様に scan_fmt マクロが存在する。
1+
//! Rust には scanf 関数はない。したがって、この節は本来は実装できない。
2+
//! Rust のマクロを使用すると scanf に近い実装を作ることができるので、参考程度に実装しておく。
3+
//! マクロを自前実装する以外の選択肢としては、下記のようなクレートを使用する手もある。
4+
//! - [text_io](https://github.com/oli-obk/rust-si): scan マクロが存在する。
5+
//! - [scan_fmt](https://github.com/wlentz/scan_fmt): 同様に scan_fmt マクロが存在する。
66
77
/// scan! マクロ。
88
/// scan!("<入れた文字>", セパレータの設定, 型情報*) と値を入れていくと、scanf とほぼ同等の動きをする。
@@ -20,8 +20,7 @@ macro_rules! scan {
2020

2121
const SOURCE: &str = "123 1.234 1.0e4 test";
2222

23-
fn main() -> std::io::Result<()> {
23+
fn main() {
2424
let (i, f, g, s) = scan!(SOURCE, char::is_whitespace, i32, f64, f64, String);
2525
println!("i={} f={} g={} s={}", i, f, g, s);
26-
Ok(())
2726
}

0 commit comments

Comments
 (0)