scm/mononoke: convert phases to use std::convert::TryFrom

Summary: Remove use of try_from crate now that it's stable.

Reviewed By: farnz

Differential Revision: D17550530

fbshipit-source-id: 1537af929fb294a725a44003fa5c34620a4cba3b
This commit is contained in:
Jeremy Fitzhardinge 2019-09-24 09:49:26 -07:00 committed by Facebook Github Bot
parent 2b359e1501
commit 33637c936e
2 changed files with 4 additions and 4 deletions

View File

@ -17,10 +17,10 @@ use mononoke_types::{ChangesetId, RepositoryId};
use stats::{define_stats, Timeseries};
use std::{
collections::{HashMap, HashSet},
convert::TryInto,
sync::Arc,
time::Duration,
};
use try_from::TryInto;
// Memcache constants, should be changed when we want to invalidate memcache
// entries

View File

@ -29,9 +29,9 @@ pub use sql_ext::SqlConstructors;
use stats::{define_stats, Timeseries};
use std::{
collections::{HashMap, HashSet},
convert::TryFrom,
fmt,
};
use try_from::TryFrom;
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum Phase {
@ -58,9 +58,9 @@ impl fmt::Display for Phase {
}
impl TryFrom<iobuf::IOBuf> for Phase {
type Err = ErrorKind;
type Error = ErrorKind;
fn try_from(buf: iobuf::IOBuf) -> ::std::result::Result<Self, Self::Err> {
fn try_from(buf: iobuf::IOBuf) -> ::std::result::Result<Self, Self::Error> {
let v: Vec<u8> = buf.into();
match std::str::from_utf8(&v) {
Ok("Draft") => Ok(Phase::Draft),