mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Update to Rust 1.80
https://github.com/ankitects/anki/pull/3329#issuecomment-2254538270
This commit is contained in:
parent
b1bf1c3141
commit
ca4393142e
7 changed files with 20 additions and 23 deletions
|
@ -368,8 +368,8 @@ pub trait FilesHandle {
|
||||||
/// different variables. This is a shortcut for calling .expand_inputs()
|
/// different variables. This is a shortcut for calling .expand_inputs()
|
||||||
/// and then .add_inputs_vec()
|
/// and then .add_inputs_vec()
|
||||||
/// - If the variable name is non-empty, a variable of the same name will be
|
/// - If the variable name is non-empty, a variable of the same name will be
|
||||||
/// created so the file list can be accessed in the command. By convention,
|
/// created so the file list can be accessed in the command. By
|
||||||
/// this is often `in`.
|
/// convention, this is often `in`.
|
||||||
fn add_inputs(&mut self, variable: &'static str, inputs: impl AsRef<BuildInput>);
|
fn add_inputs(&mut self, variable: &'static str, inputs: impl AsRef<BuildInput>);
|
||||||
fn add_inputs_vec(&mut self, variable: &'static str, inputs: Vec<String>);
|
fn add_inputs_vec(&mut self, variable: &'static str, inputs: Vec<String>);
|
||||||
fn add_order_only_inputs(&mut self, variable: &'static str, inputs: impl AsRef<BuildInput>);
|
fn add_order_only_inputs(&mut self, variable: &'static str, inputs: impl AsRef<BuildInput>);
|
||||||
|
@ -392,14 +392,14 @@ pub trait FilesHandle {
|
||||||
/// Add outputs to the build statement. Can be called multiple times with
|
/// Add outputs to the build statement. Can be called multiple times with
|
||||||
/// different variables.
|
/// different variables.
|
||||||
/// - Each output automatically has $builddir/ prefixed to it if it does not
|
/// - Each output automatically has $builddir/ prefixed to it if it does not
|
||||||
/// already start with it.
|
/// already start with it.
|
||||||
/// - If the variable name is non-empty, a variable of the same name will be
|
/// - If the variable name is non-empty, a variable of the same name will be
|
||||||
/// created so the file list can be accessed in the command. By convention,
|
/// created so the file list can be accessed in the command. By
|
||||||
/// this is often `out`.
|
/// convention, this is often `out`.
|
||||||
/// - If subgroup is true, the files are also placed in a subgroup. Eg
|
/// - If subgroup is true, the files are also placed in a subgroup. Eg if a
|
||||||
/// if a rule `foo` exists and subgroup `bar` is provided, the files are
|
/// rule `foo` exists and subgroup `bar` is provided, the files are
|
||||||
/// accessible via `:foo:bar`. The variable name must not be empty, or
|
/// accessible via `:foo:bar`. The variable name must not be empty, or
|
||||||
/// called `out`.
|
/// called `out`.
|
||||||
fn add_outputs_ext(
|
fn add_outputs_ext(
|
||||||
&mut self,
|
&mut self,
|
||||||
variable: impl Into<String>,
|
variable: impl Into<String>,
|
||||||
|
|
|
@ -251,7 +251,7 @@ impl BuildAction for PythonTest {
|
||||||
build.add_variable("folder", self.folder);
|
build.add_variable("folder", self.folder);
|
||||||
build.add_variable(
|
build.add_variable(
|
||||||
"pythonpath",
|
"pythonpath",
|
||||||
&self.python_path.join(if cfg!(windows) { ";" } else { ":" }),
|
self.python_path.join(if cfg!(windows) { ";" } else { ":" }),
|
||||||
);
|
);
|
||||||
build.add_env_var("PYTHONPATH", "$pythonpath");
|
build.add_env_var("PYTHONPATH", "$pythonpath");
|
||||||
build.add_env_var("ANKI_TEST_MODE", "1");
|
build.add_env_var("ANKI_TEST_MODE", "1");
|
||||||
|
|
|
@ -97,6 +97,7 @@ fn format_comments(comments: &Option<String>) -> String {
|
||||||
/// - it has a single field
|
/// - it has a single field
|
||||||
/// - its name ends in Request
|
/// - its name ends in Request
|
||||||
/// - it has any optional fields
|
/// - it has any optional fields
|
||||||
|
///
|
||||||
/// ...then destructuring will be skipped, and the method will take the input
|
/// ...then destructuring will be skipped, and the method will take the input
|
||||||
/// message directly. Returns (params_line, assignment_lines)
|
/// message directly. Returns (params_line, assignment_lines)
|
||||||
fn maybe_destructured_input(input: &MessageDescriptor) -> (String, String) {
|
fn maybe_destructured_input(input: &MessageDescriptor) -> (String, String) {
|
||||||
|
|
|
@ -29,12 +29,12 @@ use walkdir::WalkDir;
|
||||||
/// expected to exist (but may be empty).
|
/// expected to exist (but may be empty).
|
||||||
///
|
///
|
||||||
/// - If a method is listed in BackendExampleService and not in ExampleService,
|
/// - If a method is listed in BackendExampleService and not in ExampleService,
|
||||||
/// that method is only available with a Backend.
|
/// that method is only available with a Backend.
|
||||||
/// - If a method is listed in both services, you can provide separate
|
/// - If a method is listed in both services, you can provide separate
|
||||||
/// implementations for each of the traits.
|
/// implementations for each of the traits.
|
||||||
/// - If a method is listed only in ExampleService, a forwarding method on
|
/// - If a method is listed only in ExampleService, a forwarding method on
|
||||||
/// Backend is automatically implemented. This bypasses the trait and implements
|
/// Backend is automatically implemented. This bypasses the trait and
|
||||||
/// directly on Backend.
|
/// implements directly on Backend.
|
||||||
///
|
///
|
||||||
/// It's important that service and method indices are the same for
|
/// It's important that service and method indices are the same for
|
||||||
/// client-generated code, so the client code should use the .index fields
|
/// client-generated code, so the client code should use the .index fields
|
||||||
|
|
|
@ -160,10 +160,7 @@ impl Collection {
|
||||||
(SAMPLE_JS, JS_DATA),
|
(SAMPLE_JS, JS_DATA),
|
||||||
] {
|
] {
|
||||||
// data should have been copied correctly
|
// data should have been copied correctly
|
||||||
assert_eq!(
|
assert_eq!(read_file(self.media_folder.join(fname)).unwrap(), orig_data);
|
||||||
read_file(&self.media_folder.join(fname)).unwrap(),
|
|
||||||
orig_data
|
|
||||||
);
|
|
||||||
// and checksums in media db should be valid
|
// and checksums in media db should be valid
|
||||||
assert_eq!(*csums.get(fname).unwrap(), sha1_of_data(orig_data));
|
assert_eq!(*csums.get(fname).unwrap(), sha1_of_data(orig_data));
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,9 @@ use crate::sync::request::header_and_stream::encode_zstd_body_stream;
|
||||||
use crate::sync::response::ORIGINAL_SIZE;
|
use crate::sync::response::ORIGINAL_SIZE;
|
||||||
|
|
||||||
/// Serves two purposes:
|
/// Serves two purposes:
|
||||||
/// - allows us to monitor data sending/receiving and abort if
|
/// - allows us to monitor data sending/receiving and abort if the transfer
|
||||||
/// the transfer stalls
|
/// stalls
|
||||||
/// - allows us to monitor amount of data moving, to provide progress
|
/// - allows us to monitor amount of data moving, to provide progress reporting
|
||||||
/// reporting
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct IoMonitor(pub Arc<Mutex<IoMonitorInner>>);
|
pub struct IoMonitor(pub Arc<Mutex<IoMonitorInner>>);
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
# older versions may fail to compile; newer versions may fail the clippy tests
|
# older versions may fail to compile; newer versions may fail the clippy tests
|
||||||
channel = "1.79"
|
channel = "1.80"
|
||||||
|
|
Loading…
Reference in a new issue