google / alioth

Experimental KVM-based type-2 hypervisor in Rust implemented from scratch.
Apache License 2.0
164 stars 10 forks source link

fix(aco)!: do not deserialize empty string to None #100

Closed Lencerf closed 4 months ago

Lencerf commented 4 months ago

For a struct like

  struct Foo {
    path: PathBuf,
    param: Option<String>,
  }

to set param to None, it is more intuitive to write path=foo than path=foo,param=. The latter looks more like setting param to Some("").

On the other hand, if the value is an id and the id points to an empty string, it is interpreted as None.

Fixes: 8f3ba3445ac4 ("fix(aco): differentiate Some("") from None")