Skip to content

Commit f5a6b30

Browse files
committed
docs: formatting
1 parent b7f55bc commit f5a6b30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ Note that BorrowChecker.jl does not prevent you from cheating the system and usi
8585
### Basics
8686

8787
- `@own [:mut] x = value`: Create a new owned value (mutable if `:mut` is specified)
88-
- These are `Owned{T}` and `OwnedMut{T}` objects, respectively.
89-
- You can use `@own [:mut] x` as a shorthand for `@own [:mut] x = x` to create owned values at the start of a function.
88+
- These are `Owned{T}` and `OwnedMut{T}` objects, respectively.
89+
- You can use `@own [:mut] x` as a shorthand for `@own [:mut] x = x` to create owned values at the start of a function.
9090
- `@move [:mut] new = old`: Transfer ownership from one variable to another (mutable destination if `:mut` is specified). _Note that this is simply a more explicit version of `@own` for moving values._
9191
- `@clone [:mut] new = old`: Create a deep copy of a value without moving the source (mutable destination if `:mut` is specified).
9292
- `@take[!] var`: Unwrap an owned value. Using `@take!` will mark the original as moved, while `@take`will perform a copy.
@@ -96,12 +96,12 @@ Note that BorrowChecker.jl does not prevent you from cheating the system and usi
9696

9797
- `@lifetime lt begin ... end`: Create a scope for references whose lifetimes `lt` are the duration of the block
9898
- `@ref ~lt [:mut] var = value`: Create a reference, for the duration of `lt`, to owned value `value` and assign it to `var` (mutable if `:mut` is specified)
99-
- These are `Borrowed{T}` and `BorrowedMut{T}` objects, respectively. Use these in the signature of any function you wish to make compatible with references. In the signature you can use `OrBorrowed{T}` and `OrBorrowedMut{T}` to also allow regular `T`.
99+
- These are `Borrowed{T}` and `BorrowedMut{T}` objects, respectively. Use these in the signature of any function you wish to make compatible with references. In the signature you can use `OrBorrowed{T}` and `OrBorrowedMut{T}` to also allow regular `T`.
100100

101101
### Automatic Ownership Transfer
102102

103103
- `BorrowChecker.Experimental.@managed begin ... end`: create a scope where contextual dispatch is performed using [Cassette.jl](https://github.com/JuliaLabs/Cassette.jl): recursively, all functions (_**in all dependencies**_) are automatically modified to apply `@take!` to any `Owned{T}` or `OwnedMut{T}` input arguments.
104-
- Note: this is an experimental feature that may change or be removed in future versions. It relies on compiler internals and seems to break on certain functions (like SIMD operations).
104+
- Note: this is an experimental feature that may change or be removed in future versions. It relies on compiler internals and seems to break on certain functions (like SIMD operations).
105105

106106
### Assignment
107107

@@ -194,7 +194,7 @@ ERROR: Variable `y` holds an object that was reassigned from `x`.
194194

195195
This won't catch all misuses but it can help prevent some.
196196

197-
### References and Lifetimes
197+
### Lifetimes
198198

199199
References let you temporarily _borrow_ values. This is useful for passing values to functions without moving them. These are created within an explicit `@lifetime` block:
200200

0 commit comments

Comments
 (0)