Skip to content

Commit

Permalink
Merge pull request #401 from sunriseos/dependabot/cargo/bstr-0.2.6
Browse files Browse the repository at this point in the history
Bump bstr from 0.1.4 to 0.2.6
  • Loading branch information
Thomas Guillemard authored Aug 6, 2019
2 parents a399996 + d22e61a commit 7a9498c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wall-clock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ edition = "2018"
sunrise-libuser = { path = "../libuser" }
log = "0.4.6"
spin = "0.5"
bstr = { version = "0.1", default-features = false }
bstr = { version = "0.2", default-features = false }
5 changes: 3 additions & 2 deletions wall-clock/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use sunrise_libuser::time::{RTCManagerProxy, StaticServiceProxy, TimeZoneRule, C
use spin::Mutex;

use bstr::BStr;
use bstr::ByteSlice;

/// Turns a day of week number from RTC into an english string.
/// ///
Expand Down Expand Up @@ -109,11 +110,11 @@ fn main() {

// Get default timezone name
let device_location = timezone_service.get_device_location_name().unwrap();
let device_location_trimed = BStr::from_bytes(&device_location).trim_with(|c| c == '\0');
let device_location_trimed = device_location.as_bstr().trim_with(|c| c == '\0').as_bstr();

// Let's get New York time
let custom_location = b"America/New_York\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
let custom_location_trimed = BStr::from_bytes(&custom_location[..]).trim_with(|c| c == '\0');
let custom_location_trimed = custom_location.as_bstr().trim_with(|c| c == '\0').as_bstr();

// Load a custom one
let mut rule = TIMEZONE_RULE.lock();
Expand Down

0 comments on commit 7a9498c

Please sign in to comment.