File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
bindings/tmc-langs-node/src
tmc-langs-util/src/file_util Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff 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}" ) ]
Original file line number Diff line number Diff 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 ) ,
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ use ts_rs::TS;
1717
1818#[ cfg( unix) ]
1919pub 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 ) ]
Original file line number Diff line number Diff line change 11//! Contains the main error type for tmc-langs.
22
3- use crate :: course_refresher:: ModeBits ;
43use std:: { path:: PathBuf , string:: FromUtf8Error } ;
54use thiserror:: Error ;
65use 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 ) ]
1012pub enum LangsError {
You can’t perform that action at this time.
0 commit comments