Support rust 1.51.0 (#789)
This commit is contained in:
committed by
GitHub
parent
6ef5423d68
commit
539b267eef
@@ -136,5 +136,9 @@ pub fn require<T: AsRef<OsStr> + Debug>(binary_name: T) -> Result<PathBuf> {
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn require_option<T>(option: Option<T>, cause: String) -> Result<T> {
|
||||
option.ok_or_else(|| SkipStep(cause).into())
|
||||
if let Some(value) = option {
|
||||
Ok(value)
|
||||
} else {
|
||||
Err(SkipStep(cause).into())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user