Skip to content

Instantly share code, notes, and snippets.

@KOBA789
Created January 8, 2024 12:08
Show Gist options
  • Save KOBA789/605939bf3458c7a2a1597532625948f6 to your computer and use it in GitHub Desktop.
Save KOBA789/605939bf3458c7a2a1597532625948f6 to your computer and use it in GitHub Desktop.
// この関数と同等のコードを Rust で書いてください
// ヒント:
// - 文字列の結合やテンプレーティングは format!() マクロが使えます
// - Map 相当のデータ構造は std::collections::HashMap が使えます
function greetMap(id: number, name: string): Map<number, string> {
const map = new Map();
const message = `Hello, ${name}!`;
map.set(id, message);
return map;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment