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: seals.rs
    path of file: ./repos/rustix/tests/fs
    
    the code of the file until where you have to start completion: #[test]
fn test_seals() {
    use rustix::fs::{
        fcntl_add_seals, fcntl_get_seals, ftruncate, memfd_create, MemfdFlags, SealFlags,
    };
    use std::fs::File;
    use std::io::Write;

    let fd = match memfd_create("test", MemfdFlags::CLOEXEC | MemfdFlags::ALLOW_SEA
    
fn test_seals() {
    use rustix::fs::{
        fcntl_add_seals, fcntl_get_seals, ftruncate, memfd_create, MemfdFlags, SealFlags,
    };
    use std::fs::File;
    use std::io::Write;

    let fd = match memfd_create("test", MemfdFlags::CLOEXEC | MemfdFlags::ALLOW_SEALING) {
        Ok(fd) => fd,
        Err(rustix::io::Errno::NOSYS) => return,
        Err(err) => panic!("{:?}", err),
    };
    let mut file = File::from(fd);

    let old = fcntl_get_seals(&file).unwrap();
    assert_eq!(old, SealFlags::empty());

    writeln!(&mut file, "Hello!").unwrap();

    fcntl_add_seals(&file, SealFlags::GROW).unwrap();

    let now = fcntl_get_seals(&file).unwrap();
    assert_eq!(now, SealFlags::GROW);

    // We sealed growing, so this should fail.
    writeln!(&mut file, "World?").unwrap_err();

    // We can still shrink for now.
    ftruncate(&mut file, 1).unwrap();

    fcntl_add_seals(&file, SealFlags::SHRINK).unwrap();

    let now = fcntl_get_seals(&file).unwrap();
    assert_eq!(now, SealFlags::GROW | SealFlags::SHRINK);

    // We sealed shrinking, so this should fail.
    ftruncate(&mut file, 0).unwrap_err();
}