摘要:
Tips 03-21-2025 怎么拉取github的pr 首先添加上游仓库 git remote add upstream https://github.com/...git 之后,根据pr编号拉取相应的分支: git fetch upstream pull/251/head:check git 阅读全文
posted @ 2025-03-21 23:06
xwher
阅读(7)
评论(0)
推荐(0)
摘要:
这篇博客我们主要讨论non-owning的指针类型: ref。注意一个核心点,ref的lifetime不能超过借用的那个值;我们将看到ref, func, 以及用户自定义类型是如何利用lifetime使得ref的使用是安全的。 ref to values 有两种类型的ref: shared:&T,注 阅读全文
posted @ 2025-03-21 23:05
xwher
阅读(20)
评论(0)
推荐(0)
摘要:
所有权 每个值都有一个唯一的owner来决定它的lifetime;当owner被drop时,owned value将会被drop。一个变量拥有它的值;当控制离开声明这个变量的block时,这个变量将被drop,同时值也被drop。owners和owned values形成tree,rust中的每个值 阅读全文
posted @ 2025-03-21 17:58
xwher
阅读(75)
评论(0)
推荐(0)
摘要:
rust 教程 01 安装 我们通常使用rustup来安装rust的相关开发工具,默认存储在~/.cargo/bin目录下,使用如下命令即可安装rust: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # update 阅读全文
posted @ 2025-03-21 16:30
xwher
阅读(104)
评论(0)
推荐(0)