Raise an explicit panic when context_lines is 0. Fixes #37
This commit is contained in:
parent
3c784d6e9d
commit
3a938ae1d3
3 changed files with 13 additions and 1 deletions
|
|
@ -139,7 +139,8 @@ impl<'diff, 'old, 'new, 'bufs, T: DiffableStr + ?Sized> UnifiedDiff<'diff, 'old,
|
|||
/// Changes the context radius.
|
||||
///
|
||||
/// The context radius is the number of lines between changes that should
|
||||
/// be emitted. This defaults to `3`.
|
||||
/// be emitted. This defaults to `3`. This value must be one or larger or
|
||||
/// creating the diff will panic.
|
||||
pub fn context_radius(&mut self, n: usize) -> &mut Self {
|
||||
self.context_radius = n;
|
||||
self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue