mirror of
https://github.com/RustyCab/LearnRustEasy.git
synced 2026-02-02 17:59:00 +08:00
minor fixes
This commit is contained in:
@@ -1,38 +0,0 @@
|
|||||||
name: PublishMySite
|
|
||||||
|
|
||||||
# Controls when the action will run.
|
|
||||||
on:
|
|
||||||
# Triggers the workflow on push or pull request events but only for the main branch
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
||||||
jobs:
|
|
||||||
# This workflow contains a single job called "build"
|
|
||||||
build:
|
|
||||||
# The type of runner that the job will run on
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
||||||
steps:
|
|
||||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
# Build markdown files to a static site.
|
|
||||||
- name: Setup mdBook
|
|
||||||
uses: peaceiris/actions-mdbook@v1
|
|
||||||
with:
|
|
||||||
mdbook-version: "latest"
|
|
||||||
- run: mdbook build . --dest-dir ./book # --dest-dir is relative to <dir>
|
|
||||||
|
|
||||||
# Publish the static site to gh-pages branch.
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN}}
|
|
||||||
publish_dir: ./book
|
|
||||||
publish_branch: gh-pages
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
智能指针是一类数据结构,其表现类似于指针,但是相对于指针来说,还拥有额外的元数据。最明显的是它们拥有一个引用计数。引用计数记录了智能指针总共有多少个所有者,并且当没有任何所有者时清除数据。普通引用和智能指针的另一个**非常重要的区别**就是:**引用只是只借用数据的指针,而智能指针则是拥有它们指向的数据**。
|
智能指针是一类数据结构,其表现类似于指针,但是相对于指针来说,还拥有额外的元数据。普通引用和智能指针的另一个**非常重要的区别**就是:**引用只是只借用数据的指针,而智能指针则是拥有它们指向的数据**。
|
||||||
|
|
||||||
**智能指针是一个胖指针,但是胖指针不一定是智能指针**。前面章节介绍过的```String```类型就是一个智能指针,而它对应的切片引用```&str```则只仅仅是一个胖指针,区别就在于```String```类型拥有对数据的所有权,而```&str```没有。两者在内存中的示意图如下:
|
**智能指针是一个胖指针,但是胖指针不一定是智能指针**。前面章节介绍过的```String```类型就是一个智能指针,而它对应的切片引用```&str```则只仅仅是一个胖指针,区别就在于```String```类型拥有对数据的所有权,而```&str```没有。两者在内存中的示意图如下:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user