mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2025-01-01 05:31:48 +00:00
Set max DB size to 8 MiB
This commit is contained in:
parent
890185176e
commit
76dfaad9a1
@ -20,7 +20,10 @@ impl DB {
|
|||||||
let dirs = match File::open(&path) {
|
let dirs = match File::open(&path) {
|
||||||
Ok(file) => {
|
Ok(file) => {
|
||||||
let reader = BufReader::new(&file);
|
let reader = BufReader::new(&file);
|
||||||
bincode::deserialize_from(reader).context("could not deserialize database")?
|
bincode::config()
|
||||||
|
.limit(8 * 1024 * 1024) // only databases upto 8 MiB are supported
|
||||||
|
.deserialize_from(reader)
|
||||||
|
.context("could not deserialize database")?
|
||||||
}
|
}
|
||||||
Err(err) => match err.kind() {
|
Err(err) => match err.kind() {
|
||||||
io::ErrorKind::NotFound => Vec::<Dir>::new(),
|
io::ErrorKind::NotFound => Vec::<Dir>::new(),
|
||||||
|
Loading…
Reference in New Issue
Block a user