stylo: Add uses of fallible Vec, SmallVec and HashMap facilities.

Bug: 1395064
Reviewed-by: emilio
This commit is contained in:
Julian Seward 2017-09-10 12:25:01 +02:00 committed by Emilio Cobos Álvarez
parent 815fb6b058
commit c85633f48e
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
10 changed files with 125 additions and 57 deletions

View file

@ -33,6 +33,12 @@ pub struct FailedAllocationError {
reason: &'static str,
}
impl FailedAllocationError {
pub fn new(reason: &'static str) -> Self {
Self { reason }
}
}
impl error::Error for FailedAllocationError {
fn description(&self) -> &str {
self.reason