From 1c79714f34ed42a76b185c8c49fad1d827460028 Mon Sep 17 00:00:00 2001 From: Rustln Date: Thu, 24 Feb 2022 15:46:01 +0800 Subject: [PATCH] fix typo: `func` -> `fn` --- contents/basic/compound-type/enum.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contents/basic/compound-type/enum.md b/contents/basic/compound-type/enum.md index fd6595b2..33699f50 100644 --- a/contents/basic/compound-type/enum.md +++ b/contents/basic/compound-type/enum.md @@ -169,7 +169,7 @@ struct ChangeColorMessage(i32, i32, i32); // 元组结构体 例如我们有一个 WEB 服务,需要接受用户的长连接,假设连接有两种:`TcpStream` 和 `TlsStream`,但是我们希望对这两个连接的处理流程相同,也就是用同一个函数来处理这两个连接,代码如下: ```rust -func new (stream: TcpStream) { +fn new (stream: TcpStream) { let mut s = stream; if tls { s = negotiate_tls(stream)