You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: range.rs
    path of file: ./repos/occlum/src/libos/src/fs/locks/range_lock
    
    the code of the file until where you have to start completion: use super::*;

pub const OFFSET_MAX: usize = off_t::MAX as usize;

#[derive(Debug, Copy, Clone)]
pub struct FileRange {
    start: usize,
    end: usize,
}

impl FileRange {
    /// Create the range through
    
    pub fn set_end(&mut self, new_end: usize) -> Result<FileRangeChange> {
        if new_end <= self.start {
            return_errno!(EINVAL, "invalid new end");
        }
        let old_end = self.end;
        self.end = new_end;
        let change = if new_end < old_end {
            FileRangeChange::Shrinked
        } else if new_end > old_end {
            FileRangeChange::Expanded
        } else {
            FileRangeChange::Same
        };
        Ok(change)
    }