You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a nested data structure with a few unit-like structs as placeholders. When I tried to encode the structure, I received a "not all control paths return a value" when using #[deriving(Encodable] on said unit-like structs. Works great when I take said structs out or give them data.
Unsure if bug or feature.
extern crate serialize;
use serialize::{json};
#[deriving(Encodable)]
struct UnitLikeStruct;
fn main() {
let to_encode_object = UnitLikeStruct;
let encoded_str: ~str = json::Encoder::str_encode(&to_encode_object);
println!("{}", encoded_str);
}
Using a slightly older pre-nightly on Windows 7:
C:\Program Files (x86)\Rust\bin\rustc.exe 0.11-pre-nightly (1853619 2014-04-17 01:31:27 -0700)
The text was updated successfully, but these errors were encountered:
Sawyer47
added a commit
to Sawyer47/rust
that referenced
this issue
Jun 2, 2014
…#14021)
part of rust-lang/rust-clippy#9100
The `obfuscated_if_else` lint currently only triggers for the pattern
`.then_some(..).unwrap_or(..)`, but there're other cases where this lint
should be triggered, one of which is `.then(..).unwrap_or(..)`.
changelog: [`obfuscated_if_else`]: trigger lint for the
`.then(..).unwrap_or(..)` pattern as well
I have a nested data structure with a few unit-like structs as placeholders. When I tried to encode the structure, I received a "not all control paths return a value" when using #[deriving(Encodable] on said unit-like structs. Works great when I take said structs out or give them data.
Unsure if bug or feature.
Using a slightly older pre-nightly on Windows 7:
C:\Program Files (x86)\Rust\bin\rustc.exe 0.11-pre-nightly (1853619 2014-04-17 01:31:27 -0700)
The text was updated successfully, but these errors were encountered: