#[derive(Serialize)]
pub struct SLPInfoVersion {
name: String,
protocol: i32
}
impl SLPInfoVersion {
lazy_static! {
pub static ref V1_13: MyStruct = (SLPInfoVersion {
name: "1.13".to_string(),
protocol: 404
});
}
}
The lazy_static!
call gives me this error:
error: expected one of `(`, `async`, `const`, `default`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `struct`
--> src\protocol\packet\mod.rs:244:2
|
244 | lazy_static! {
| _____^
| |_____|
| ||_____|
| |||
245 | ||| pub static ref V1_13: SLPInfoVersion = (SLPInfoVersion {
246 | ||| name: "1.13".to_string(),
247 | ||| protocol: 404
248 | ||| });
249 | ||| }
| ||| ^
| |||_____|
| ||______expected one of 9 possible tokens here
| |_______unexpected token
| in this macro invocation
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
I am using Rust 1.32.0.