From 14a2600176789cb30ab311e8f036d0390b151ba6 Mon Sep 17 00:00:00 2001 From: katopz Date: Mon, 7 Nov 2022 11:02:49 +0700 Subject: [PATCH] fix: correct , to . --- en/src/lifetime/advance.md | 12 ++++++------ en/src/lifetime/static.md | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/en/src/lifetime/advance.md b/en/src/lifetime/advance.md index 06b4689..af50ab7 100644 --- a/en/src/lifetime/advance.md +++ b/en/src/lifetime/advance.md @@ -39,7 +39,7 @@ fn main() { } ``` -1,🌟 +1. 🌟 ```rust,editable /* Annotate struct with lifetime: 1. `r` and `s` must have different lifetimes @@ -55,7 +55,7 @@ fn main() { ``` -2,🌟🌟 +2. 🌟🌟 ```rust,editable /* Adding trait bounds to make it work */ struct ImportantExcerpt<'a> { @@ -74,7 +74,7 @@ fn main() { } ``` -3,🌟🌟 +3. 🌟🌟 ```rust,editable /* Adding trait bounds to make it work */ fn f<'a, 'b>(x: &'a i32, mut y: &'b i32) { @@ -100,7 +100,7 @@ and could then be used to compare a `&'a T` with any lifetime to an `i32`. Only a higher-ranked bound can be used here, because the lifetime of the reference is shorter than any possible lifetime parameter on the function. -4,🌟🌟🌟 +4. 🌟🌟🌟 ```rust,editable /* Adding HRTB to make it work!*/ fn call_on_ref_zero<'a, F>(f: F) where F: Fn(&'a i32) { @@ -187,7 +187,7 @@ fn main() { ``` -5,🌟🌟 +5. 🌟🌟 ```rust,editable /* Make it work by reordering some code */ fn main() { @@ -235,7 +235,7 @@ struct Ref<'a, T> { ## A difficult exercise -6,🌟🌟🌟🌟 +6. 🌟🌟🌟🌟 ```rust,editable /* Make it work */ struct Interface<'a> { diff --git a/en/src/lifetime/static.md b/en/src/lifetime/static.md index 8c563dc..d7db355 100644 --- a/en/src/lifetime/static.md +++ b/en/src/lifetime/static.md @@ -32,7 +32,7 @@ fn need_static(r : &'static str) { } ``` -2, 🌟🌟🌟🌟 Another way to make `'static` lifetime is using `Box::leak` +2. 🌟🌟🌟🌟 Another way to make `'static` lifetime is using `Box::leak` ```rust,editable #[derive(Debug)] struct Config { @@ -59,7 +59,7 @@ fn main() { } ``` -3, 🌟 `&'static` only indicates that the data can live forever, not the reference. The latter one will be constrained by its scope. +3. 🌟 `&'static` only indicates that the data can live forever, not the reference. The latter one will be constrained by its scope. ```rust,editable fn main() { { @@ -75,7 +75,7 @@ fn main() { } ``` -4, `&'static` can be coerced to a shorter lifetime. +4. `&'static` can be coerced to a shorter lifetime. **Example** ```rust,editable @@ -112,7 +112,7 @@ As a trait bound, it means the type does not contain any non-static references. It's important to understand this means that any owned data always passes a `'static `lifetime bound, but a reference to that owned data generally does not. -5,🌟🌟 +5. 🌟🌟 ```rust,editable /* Make it work */ use std::fmt::Debug; @@ -147,7 +147,7 @@ fn main() { ``` -6,🌟🌟🌟 +6. 🌟🌟🌟 ```rust,editable use std::fmt::Display;