Parcourir la source

docs: Use latest in docs.rs links

armaniferrante il y a 4 ans
Parent
commit
80ddf04307
2 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 3 3
      docs/src/tutorials/tutorial-2.md
  2. 1 1
      docs/src/tutorials/tutorial-5.md

+ 3 - 3
docs/src/tutorials/tutorial-2.md

@@ -9,11 +9,11 @@ For example, one could imagine easily writing a faulty token program that forget
 
 To address these problems, Anchor provides several types, traits, and macros. It's easiest to understand by seeing how they're used in an example, but a couple include
 
-* [Accounts](https://docs.rs/anchor-lang/0.1.0/anchor_lang/derive.Accounts.html): derive macro implementing the `Accounts` [trait](https://docs.rs/anchor-lang/0.1.0/anchor_lang/trait.Accounts.html), allowing a struct to transform
+* [Accounts](https://docs.rs/anchor-lang/latest/anchor_lang/derive.Accounts.html): derive macro implementing the `Accounts` [trait](https://docs.rs/anchor-lang/latest/anchor_lang/trait.Accounts.html), allowing a struct to transform
 from the untrusted `&[AccountInfo]` slice given to a Solana program into a validated struct
 of deserialized account types.
-* [#[account]](https://docs.rs/anchor-lang/0.1.0/anchor_lang/attr.account.html): attribute macro implementing [AccountSerialize](https://docs.rs/anchor-lang/0.1.0/anchor_lang/trait.AccountSerialize.html) and [AccountDeserialize](https://docs.rs/anchor-lang/0.1.0/anchor_lang/trait.AnchorDeserialize.html), automatically prepending a unique 8 byte discriminator to the account array. The discriminator is defined by the first 8 bytes of the `Sha256` hash of the account's Rust identifier--i.e., the struct type name--and ensures no account can be substituted for another.
-* [ProgramAccount](https://docs.rs/anchor-lang/0.1.0/anchor_lang/struct.ProgramAccount.html): a wrapper type for a deserialized account implementing `AccountDeserialize`. Using this type within an `Accounts` struct will ensure the account is **owned** by the currently executing program.
+* [#[account]](https://docs.rs/anchor-lang/latest/anchor_lang/attr.account.html): attribute macro implementing [AccountSerialize](https://docs.rs/anchor-lang/latest/anchor_lang/trait.AccountSerialize.html) and [AccountDeserialize](https://docs.rs/anchor-lang/latest/anchor_lang/trait.AnchorDeserialize.html), automatically prepending a unique 8 byte discriminator to the account array. The discriminator is defined by the first 8 bytes of the `Sha256` hash of the account's Rust identifier--i.e., the struct type name--and ensures no account can be substituted for another.
+* [ProgramAccount](https://docs.rs/anchor-lang/latest/anchor_lang/struct.ProgramAccount.html): a wrapper type for a deserialized account implementing `AccountDeserialize`. Using this type within an `Accounts` struct will ensure the account is **owned** by the currently executing program.
 
 With the above, we can define preconditions for our any instruction handler expecting a certain set of
 accounts, allowing us to more easily reason about the security of our programs.

+ 1 - 1
docs/src/tutorials/tutorial-5.md

@@ -30,7 +30,7 @@ pub enum ErrorCode {
 }
 ```
 
-Observe the [#[error]](https://docs.rs/anchor-lang/0.1.0/anchor_lang/attr.error.html) attribute on the `ErrorCode` enum. This macro generates two types: an `Error` and a `Result`, both of which can be used when returning from your program.
+Observe the [#[error]](https://docs.rs/anchor-lang/latest/anchor_lang/attr.error.html) attribute on the `ErrorCode` enum. This macro generates two types: an `Error` and a `Result`, both of which can be used when returning from your program.
 
 To use the `Error`, one can simply use the user defined `ErrorCode` with Rust's [From](https://doc.rust-lang.org/std/convert/trait.From.html) trait. If you're unfamiliar with `From`, no worries. Just know that you need to either call
 `.into()` when using your `ErrorCode`. Or use Rust's `?` operator, when returning an error.