| author | |
| committer | |
| log | 056d1cf622d6bb20abd1376d48307d0506f94f39 |
| tree | 64938dffa3d1c2fc97800f8c29d51b1d30ac961e |
| parent | 142c8f9c9d68cacd0497db0f916de8d72514d52c |
| signature | Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU (~clover) |
Keep the shared rename state concrete with a field-local complexity allowance;
remove a needless fixture borrow and collapse the unread transition condition.
Assisted-by: gpt-6.1-sol2 files changed, 6 insertions(+), 5 deletions(-)
crates/snowbound/src/library.rs+2-1| ... | ... | @@ -326,6 +326,7 @@ pub struct Library { |
| 326 | 326 | /// Sections opened ahead of being shown, or left open after, most recent first, which |
| 327 | 327 | /// `open` hands out before opening any. |
| 328 | 328 | kept: Mutex<crate::prefetch::Recent<String, Section>>, |
| 329 | #[allow(clippy::type_complexity)] | |
| 329 | 330 | pub(crate) renames: Arc<Mutex<BTreeMap<[u8; 16], (String, Arc<()>)>>>, |
| 330 | 331 | pub(crate) structure: Arc<async_lock::Mutex<()>>, |
| 331 | 332 | themes: Mutex<ThemeCache>, |
| ... | ... | @@ -1745,7 +1746,7 @@ mod tests { |
| 1745 | 1746 | let file = root.join("Stalled.one"); |
| 1746 | 1747 | notebook::fs::write( |
| 1747 | 1748 | &file, |
| 1748 | &onestore::create_section("Stalled.one", "", "Author").unwrap(), | |
| 1749 | onestore::create_section("Stalled.one", "", "Author").unwrap(), | |
| 1749 | 1750 | ) |
| 1750 | 1751 | .unwrap(); |
| 1751 | 1752 | let (entered, waiting) = mpsc::channel(); |
crates/snowbound/src/unread.rs+4-4| ... | ... | @@ -283,10 +283,10 @@ impl State { |
| 283 | 283 | if self.reads.viewing.as_ref().is_some_and(same) { |
| 284 | 284 | return; |
| 285 | 285 | } |
| 286 | if let Some((notebook, section, space, kept)) = self.reads.viewing.take() { | |
| 287 | if !kept { | |
| 288 | self.reads.mark_read(&notebook, section, Some(space)); | |
| 289 | } | |
| 286 | if let Some((notebook, section, space, kept)) = self.reads.viewing.take() | |
| 287 | && !kept | |
| 288 | { | |
| 289 | self.reads.mark_read(&notebook, section, Some(space)); | |
| 290 | 290 | } |
| 291 | 291 | self.reads.viewing = |
| 292 | 292 | viewing.map(|(notebook, section, space)| (notebook, section, space, false)); |