Make the recommended changed from code review.

This commit is contained in:
Richard Dodd
2018-09-30 12:34:52 +01:00
parent da65fe5a52
commit f1073dca04
3 changed files with 9 additions and 7 deletions
+4 -2
View File
@@ -23,14 +23,16 @@ pub struct Ctxt {
}
impl Ctxt {
/// Create a new context object
/// Create a new context object.
///
/// This object contains no errors, but will still trigger a panic if it is not `check`ed.
pub fn new() -> Self {
Ctxt {
errors: RefCell::new(Some(Vec::new())),
}
}
/// Add an error to the context object
/// Add an error to the context object.
pub fn error<T: Display>(&self, msg: T) {
self.errors
.borrow_mut()