Closed zzke closed 2 years ago
Hi.
README.md assumes that a reader is somewhat familiar with basic aspects of Rust. Please read the Error Handling section of the Rust Book (especially A Shortcut for Propagating Errors: the ? Operator) as well as the Error Handling section of the Rust by Example (especially Introducing ? and Using Result in main).
You can update your main definition to fix the error (similar definition is actually used in the example):
fn main() -> Result<(), Box<dyn std::error::Error>> {
// ...
}
Anyway, thank for report. I'll update the README example with the fake definition of main to avoid this confusion in future.
thanks!
Im trying to compile the example given in the README and it raise some errors as follows
system: macOS Big Sur rust version: 1.55.0
?
operator can only be used in a function that returnsResult
orOption
(or another type that implementsFromResidual
) --> src/main.rs:13:35?
operator in a function that returns()
14Result
orOption
to accept?
note: required by
from_residual
?
operator can only be used in a function that returnsResult
orOption
(or another type that implementsFromResidual
) --> src/main.rs:14:31?
operator in a function that returns()
...Result
orOption
to accept?
note: required by
from_residual
?
operator can only be used in a function that returnsResult
orOption
(or another type that implementsFromResidual
) --> src/main.rs:16:35?
operator in a function that returns()
...Result
orOption
to accept?
note: required by
from_residual
?
operator can only be used in a function that returnsResult
orOption
(or another type that implementsFromResidual
) --> src/main.rs:24:8?
operator in a function that returns()
...Result
orOption
to accept?
note: required by
from_residual
?
operator can only be used in a function that returnsResult
orOption
(or another type that implementsFromResidual
) --> src/main.rs:43:6?
operator in a function that returns()
...Result
orOption
to accept?
note: required by
from_residual
?
operator can only be used in a function that returnsResult
orOption
(or another type that implementsFromResidual
) --> src/main.rs:52:10?
operator in a function that returns()
...Result
orOption
to accept?
note: required by
from_residual
For more information about this error, try
rustc --explain E0277
. error: could not compilerust-mysql-simple
due to 6 previous errors