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: static_cell.rs
    path of file: ./repos/RustPython/common/src
    
    the code of the file until where you have to start completion: #[cfg(not(feature = "threading"))]
mod non_threading {
    use crate::lock::OnceCell;
    use std::thread::LocalKey;

    pub struct StaticCell<T: 'static> {
        inner: &'static LocalKey<OnceCell<&'static T>>,
    }

    f
    
        pub fn set(&'static self, value: T) -> Result<(), T> {
            // thread-safe because it's a unsync::OnceCell
            self.inner.with(|x| {
                if x.get().is_some() {
                    Err(value)
                } else {
                    // will never fail
                    let _ = x.set(leak(value));
                    Ok(())
                }
            })
        }