MK
Size: a a a
MK
MK
MK
MK
SS
MK
MK
MK
MK
M
pub type Result<T: Serialize> = std::result::Result<T, Error>;
impl<T> std::convert::From<self::Result<T>> for actix_web::HttpResponse
where
T: Serialize,
{
fn from(result: self::Result<T>) -> Self {
match result {
Ok(v) => HttpResponse::Ok().json(&v),
Err(err) => err.into(),
}
}
}
|
40 | impl<T> std::convert::From<self::Result<T>> for actix_web::HttpResponse
| ^ ----------------------------------- ----------------------- `HttpResponse` is not defined in the current crate
| | |
| _| `std::result::Result` is not defined in the current crate
| |
41 | | where
42 | | T: Serialize,
43 | | {
... |
49 | | }
50 | | }
| |_^ impl doesn't use only types from inside the current crate
|
= note: define and implement a trait or new type instead
r
pub type Result<T: Serialize> = std::result::Result<T, Error>;
impl<T> std::convert::From<self::Result<T>> for actix_web::HttpResponse
where
T: Serialize,
{
fn from(result: self::Result<T>) -> Self {
match result {
Ok(v) => HttpResponse::Ok().json(&v),
Err(err) => err.into(),
}
}
}
|
40 | impl<T> std::convert::From<self::Result<T>> for actix_web::HttpResponse
| ^ ----------------------------------- ----------------------- `HttpResponse` is not defined in the current crate
| | |
| _| `std::result::Result` is not defined in the current crate
| |
41 | | where
42 | | T: Serialize,
43 | | {
... |
49 | | }
50 | | }
| |_^ impl doesn't use only types from inside the current crate
|
= note: define and implement a trait or new type instead
M
JM
SS
FI
K
std::env::args
) содержит путь исполняемого файла (относительный или абсолютный), не уверен правда, что это кросс-платформенное поведениеr
FI
АК
vec![1, -2, 3].into_iter().map(u32::try_from)
- итератор из Option (или в общем случае Result). Как превратить его в Option (или Result) от итератора без промежуточных контейнеров?r
vec![1, -2, 3].into_iter().map(u32::try_from)
- итератор из Option (или в общем случае Result). Как превратить его в Option (или Result) от итератора без промежуточных контейнеров?let result: Result<Vec<_>, _> = iter.collect();