Skip to content

Project4: KvStore set method directly write key value to the file #462

@logere

Description

@logere

Should we first check if the key exists?

    fn set(&self, key: String, value: String) -> Result<()> {
        if let Some(_) = self.index.get(&key) {
            return Ok(());
        } 
        self.writer.lock().unwrap().set(key, value)
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions