Skip to content

Commit 3c8f892

Browse files
committed
Fix examples
1 parent 655300d commit 3c8f892

File tree

4 files changed

+7
-31
lines changed

4 files changed

+7
-31
lines changed

examples/arc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ fn main() -> Result<(), LvError> {
3939
let mut arc = Arc::new(&mut screen)?;
4040
arc.set_size(150, 150)?;
4141
arc.set_align(&mut screen, Align::Center, 0, 10)?;
42-
arc.set_start_angle(135, ArcPart::Indicator)?;
43-
arc.set_end_angle(135, ArcPart::Indicator)?;
42+
arc.set_start_angle(135)?;
43+
arc.set_end_angle(135)?;
4444

4545
let mut loading_lbl = Label::new(&mut screen)?;
4646
loading_lbl.set_text("Loading...")?;
@@ -75,7 +75,7 @@ fn main() -> Result<(), LvError> {
7575
i = 1;
7676
}
7777
angle = if forward { angle + 1 } else { angle - 1 };
78-
arc.set_end_angle(angle + 135, ArcPart::Indicator)?;
78+
arc.set_end_angle(angle + 135)?;
7979
i += 1;
8080

8181
sleep(Duration::from_millis(10));

examples/bar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn main() -> Result<(), LvError> {
4343
// // Set the indicator style for the bar object
4444
let mut ind_style = Style::default();
4545
ind_style.set_bg_color(State::DEFAULT, Color::from_rgb((100, 245, 100)));
46-
bar.add_style(BarPart::Indicator, ind_style)?;
46+
bar.add_style(Part::All, ind_style)?;
4747

4848
let mut loading_lbl = Label::new(&mut screen)?;
4949
loading_lbl.set_text("Loading...")?;

examples/gauge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn main() -> Result<(), LvError> {
5353
gauge_style.set_scale_end_border_width(State::DEFAULT, 4);
5454

5555
let mut gauge = Gauge::new(&mut screen)?;
56-
gauge.add_style(GaugePart::Main, gauge_style)?;
56+
gauge.add_style(Part::Main, gauge_style)?;
5757
gauge.set_align(&mut screen, Align::Center, 0, 0)?;
5858
gauge.set_value(0, 50)?;
5959

lvgl-sys/src/string_impl.rs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
// SOFTWARE.
2222

23-
use core::{mem, ptr, slice, usize};
23+
use core::{ptr, usize};
2424
use cty::*;
2525

2626
#[no_mangle]
@@ -147,7 +147,7 @@ pub unsafe extern "C" fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t
147147
#[no_mangle]
148148
pub unsafe extern "C" fn strrchr(s: *const c_char, c: c_int) -> *mut c_char {
149149
let len = strlen(s) as isize;
150-
let c = c as i8;
150+
let c = c as c_char;
151151
let mut i = len - 1;
152152
while i >= 0 {
153153
if *s.offset(i) == c {
@@ -157,27 +157,3 @@ pub unsafe extern "C" fn strrchr(s: *const c_char, c: c_int) -> *mut c_char {
157157
}
158158
ptr::null_mut()
159159
}
160-
161-
unsafe fn inner_strstr(
162-
mut haystack: *const c_char,
163-
needle: *const c_char,
164-
mask: c_char,
165-
) -> *mut c_char {
166-
while *haystack != 0 {
167-
let mut i = 0;
168-
loop {
169-
if *needle.offset(i) == 0 {
170-
// We reached the end of the needle, everything matches this far
171-
return haystack as *mut c_char;
172-
}
173-
if *haystack.offset(i) & mask != *needle.offset(i) & mask {
174-
break;
175-
}
176-
177-
i += 1;
178-
}
179-
180-
haystack = haystack.offset(1);
181-
}
182-
ptr::null_mut()
183-
}

0 commit comments

Comments
 (0)