• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cbruiz / printhor / 13753907916

10 Mar 2025 12:08AM UTC coverage: 90.771% (+0.2%) from 90.599%
13753907916

Pull #35

github

web-flow
Merge 76633dfa7 into cc61929b1
Pull Request #35: Features/s_plot recovery

442 of 472 new or added lines in 7 files covered. (93.64%)

4 existing lines in 3 files now uncovered.

14832 of 16340 relevant lines covered (90.77%)

734462.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/printhor/src/bin/instrumentation/gcode.rs
1
use std::collections::VecDeque;
2

3
pub(crate) struct GCodeBuffer {
4
    buffer: VecDeque<u8>,
5
}
6

7
impl GCodeBuffer {
8
    pub const fn new() -> Self {
1✔
9
        Self {
1✔
10
            buffer: VecDeque::new(),
1✔
11
        }
1✔
12
    }
1✔
13
    pub fn pop_front(&mut self) -> Option<u8> {
680✔
14
        self.buffer.pop_front()
680✔
15
    }
680✔
16

17
    pub fn append(&mut self, data: &str) {
25✔
18
        self.buffer.extend(data.as_bytes());
25✔
19
    }
25✔
20
}
21

22
pub(crate) struct BufferStream {
23
    inner: GCodeBuffer,
24
}
25

26
impl BufferStream {
27
    pub(crate) const fn new(buff: GCodeBuffer) -> Self {
1✔
28
        Self { inner: buff }
1✔
29
    }
1✔
30
}
31

32
impl async_gcode::ByteStream for BufferStream {
33
    type Item = Result<u8, async_gcode::Error>;
34

35
    async fn next(&mut self) -> Option<Self::Item> {
680✔
36
        match self.inner.pop_front() {
680✔
NEW
37
            None => None,
×
38
            Some(_b) => Some(Ok(_b)),
680✔
39
        }
40
    }
680✔
41

NEW
42
    async fn recovery_check(&mut self) {}
×
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc