Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

b-async-await temporary value is freed at the end of this statement

Aperta
#41 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

Start with the lines using &get_path and the Http::get signature shown in the issue. Compare the returned impl Future<Output = String> with and without use<>, then inspect the surrounding asynchronous example to determine whether the goal is an explanation or a code correction. Done means the lifetime error and the role of use<> are clearly addressed.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

second edition

These lines (any with &get_path)

let fut1 = Box::new( Http::get(&get_path(0)));

return this error

  • temporary value is freed at the end of this statement
    ---- coercion requires that borrow lasts for 'static

I did find a solution but I have yet to understand why it works, + use<>

impl Http { pub fn get(path: &str) -> impl Future<Output = String> + use<> { HttpGetFuture::new(path) } }

Lingua principale
Rust
Stelle
339
Fork
97
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PacktPublishing/Asynchronous-Programming-in-Rust

Tutte le issue di PacktPublishing/Asynchronous-Programming-in-Rust

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.