Skip to content

Commit 4ddc9cc

Browse files
committed
fixed lints on Windows
1 parent fa48cdf commit 4ddc9cc

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

bindings/tmc-langs-node/src/error.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ pub enum Error {
1414
EmptyString,
1515
#[error("String too long to be a char expected len: 1 got len: {0}")]
1616
StringTooLongForChar(usize),
17-
#[error("Expecting null")]ExpectingNull,
17+
#[error("Expecting null")]
18+
ExpectingNull,
1819
#[error("Invalid key type: {0}")]
1920
InvalidKeyType(String),
2021
#[error("Array index out of bounds: index: {0}, size: {1}")]

tmc-langs-util/src/file_util/lock_windows.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ impl FileLock {
4444
let file = open_file(&self.path)?;
4545
let lock = FdLock::new(file);
4646
self.lock = Some(lock);
47-
let lock = self.lock.as_mut().unwrap();
48-
let guard = lock.lock().unwrap();
47+
let lock = self.lock.as_mut().expect("set to Some before this call");
48+
let guard = lock.lock().expect("cannot fail on Windows");
4949
Ok(FileLockGuard {
5050
_guard: LockInner::FdLockGuard(guard),
5151
path: Cow::Borrowed(&self.path),

tmc-langs/src/course_refresher.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ use ts_rs::TS;
1717

1818
#[cfg(unix)]
1919
pub type ModeBits = nix::sys::stat::mode_t;
20-
#[cfg(not(unix))]
21-
pub type ModeBits = u32;
2220

2321
/// Data from a finished course refresh.
2422
#[derive(Debug, Serialize, Deserialize)]

tmc-langs/src/error.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
//! Contains the main error type for tmc-langs.
22
3-
use crate::course_refresher::ModeBits;
43
use std::{path::PathBuf, string::FromUtf8Error};
54
use thiserror::Error;
65
use tmc_client::ClientError;
76

7+
#[cfg(unix)]
8+
use crate::course_refresher::ModeBits;
9+
810
/// Main error type of the library.
911
#[derive(Error, Debug)]
1012
pub enum LangsError {

0 commit comments

Comments
 (0)