Why Nostr? What is Njump?
2024-06-17 05:53:48

Mike Yang on Nostr: 这个帮我大体搞明白了 ownership。 ownership 为了做 strict ...

这个帮我大体搞明白了 ownership。

ownership 为了做 strict checking,保证唯一存在,但为了方便,加了 move、borrow、mutable。mutable 想满足唯一,就要在一个 scope 里,一个变量只能有一个 mutable 的。有的变量会跳出 scope,编译器检查不出来,就得手动加 lifetime。没了。
Author Public Key
npub15tw4uye3848p3lp23h7qm4tylud53z5vt3nh8fmpd0rlj7yp0t6s5hglm3