Inconsistent snapshot return types

Aperta
#1,851 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

Look at the snapshot(), load(), and checked_load() methods in the codebase, likely in a file related to snapshot management or the sandbox. Examine from_snapshot() and restore() to see their parameter types. The task is to align return types or parameter acceptance, so start by understanding the ownership flow and the Arc<Snapshot> usage. Run existing tests to ensure changes don't break functionality.

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

Descrizione

S-needs-triage

snapshot() returns Result<Arc<Snapshot>>, but load() and checked_load() return Result<Snapshot>. Both from_snapshot() and restore() require Arc<Snapshot>, forcing callers to wrap loaded snapshots manually.

snapshot() needs shared ownership because the sandbox caches the snapshot while returning it to the caller. Loading creates a fresh value with no other owner, so returning Snapshot leaves ownership choices to the caller.

Potential fixes:

  • Return Arc<Snapshot> from both load methods.
  • Accept impl Into<Arc<Snapshot>> in from_snapshot() and restore() so either form works.
  • ... something else
Lingua principale
Rust
Stelle
4.8k
Fork
222
Merge medio
1g 16h
PR unite (30g)
60

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 hyperlight-dev/hyperlight

Tutte le issue di hyperlight-dev/hyperlight

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.