未分類 – 株式会社TerraceTech(テラステック) https://terracetech.jp ~人と技術で未来をテラス~ Sun, 18 Jul 2021 00:27:20 +0000 ja hourly 1 https://terracetech.jp/wp-content/uploads/2019/11/cropped-1657-1-32x32.png 未分類 – 株式会社TerraceTech(テラステック) https://terracetech.jp 32 32 [Rust] typeof のようにその値の型が知りたいとき https://terracetech.jp/2021/07/19/rust-typeof/ Mon, 19 Jul 2021 00:24:01 +0000 https://terracetech.jp/?p=884 [Rust] typeof のようにその値の型が知りたいとき

 

fn main() {
let mut my_number = 32.90;
my_number.what_is_this();
}

 

持っていないメソッドを実行する

   Compiling playground v0.0.1 (/playground)
error[E0599]: no method named `what_is_this` found for type `{float}` in the current scope
 --> src/main.rs:3:11
  |
3 | my_number.what_is_this();
  |           ^^^^^^^^^^^^ method not found in `{float}`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: could not compile `playground`

To learn more, run the command again with --verbose.

怒られてfloatの中にそのようなメソッドはないと言われる
floatだとわかる

]]>
明日はもりた塾 https://terracetech.jp/2020/02/22/%e6%98%8e%e6%97%a5%e3%81%af%e3%82%82%e3%82%8a%e3%81%9f%e5%a1%be/ Fri, 21 Feb 2020 15:04:31 +0000 https://terracetech.jp/?p=249 明日はもりた塾。

gitの使い方とハンズオンします。

]]>