try_drop/drop_strategies/
noop.rs

1use crate::TryDropStrategy;
2
3/// A drop strategy which does nothing if a drop error occurs.
4#[cfg_attr(
5    feature = "derives",
6    derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Default)
7)]
8pub struct NoOpDropStrategy;
9
10impl TryDropStrategy for NoOpDropStrategy {
11    fn handle_error(&self, _error: crate::Error) {}
12}
13
14#[cfg(test)]
15mod tests {
16    use super::*;
17    use crate::drop_strategies::PanicDropStrategy;
18    use crate::test_utils::{ErrorsOnDrop, Fallible};
19
20    #[test]
21    fn test_drop_strategy() {
22        let _errors =
23            ErrorsOnDrop::<Fallible, _>::given(NoOpDropStrategy, PanicDropStrategy::DEFAULT);
24    }
25}