George3d6 / Inquisitor

An easily extensible, minimal footprint monitoring tool. (Still in the testing phase)
BSD 2-Clause "Simplified" License
30 stars 4 forks source link

Enforce plugin::new() returns a result #21

Closed Deedasmi closed 6 years ago

Deedasmi commented 6 years ago

This is a canidate PR and should not be merged until discussion is finished. See #19 for discussion.

George3d6 commented 6 years ago

Unless, you think there should be a separate PR for that, as it stands this one is good on it's own as well.

Also, just to be clear, the result from cofngi should be returned after gather is called in init:

r =  Plugin::config(&mut new_plugin);
match r {
 Ok() => ()
 Error(err) => return err
}

Or some such... I'm actually not sure if return works inside the match

Deedasmi commented 6 years ago

Since that is plugin specific and is not an API change, I can make that in a separate PR.

return does work inside a match. It's kind of neat actually.

George3d6 commented 6 years ago

Oh, grand :) I might have confused that with Scala or some other language where it doesn't.

In that case I'll merge this one for now and if you can make those changes do so, otherwise I'll get to it once I'm done with the receptor.

Cheers,