Skip to content

Commit c732fdb

Browse files
authored
[rust] migrating to kj::from (#5209)
see capnproto/capnproto#2402
1 parent 1e8a049 commit c732fdb

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

build/deps/gen/dep_capnp_cpp.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
load("@//:build/http.bzl", "http_archive")
44

5-
URL = "https://github.com/capnproto/capnproto/tarball/4af6d742d88c131f6b1b4d315707483eb6897cb5"
6-
STRIP_PREFIX = "capnproto-capnproto-4af6d74/c++"
7-
SHA256 = "5fbac64487684ac5dd27198d48b8aefb863a85bb48e96b8132fca6a08a455576"
5+
URL = "https://github.com/capnproto/capnproto/tarball/c525eb1680bdd94f3d814f81f148643ee5086525"
6+
STRIP_PREFIX = "capnproto-capnproto-c525eb1/c++"
7+
SHA256 = "7b60e840dbc62bb3140a9dff9ae38253688fc63722dcea6769108e9356e6362b"
88
TYPE = "tgz"
9-
COMMIT = "4af6d742d88c131f6b1b4d315707483eb6897cb5"
9+
COMMIT = "c525eb1680bdd94f3d814f81f148643ee5086525"
1010

1111
def dep_capnp_cpp():
1212
http_archive(

build/deps/gen/dep_workerd_cxx.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
load("@//:build/http.bzl", "http_archive")
44

5-
URL = "https://github.com/cloudflare/workerd-cxx/tarball/552c0b589a9a92c706e547a4a2ad4f36deaf580b"
6-
STRIP_PREFIX = "cloudflare-workerd-cxx-552c0b5"
7-
SHA256 = "ab86d593e636604bd07c5d3af6e99d4dcb7a0763ee2b28ae8edea5ef915b1778"
5+
URL = "https://github.com/cloudflare/workerd-cxx/tarball/f0adca0c1bc030dbf051f0348fd4af8c2b1f6fac"
6+
STRIP_PREFIX = "cloudflare-workerd-cxx-f0adca0"
7+
SHA256 = "3e727bf2c060aeba327f7e91711ccd6017f9e1d937c289fb9d2f5d380000fcfa"
88
TYPE = "tgz"
9-
COMMIT = "552c0b589a9a92c706e547a4a2ad4f36deaf580b"
9+
COMMIT = "f0adca0c1bc030dbf051f0348fd4af8c2b1f6fac"
1010

1111
def dep_workerd_cxx():
1212
http_archive(

src/rust/gen-compile-cache/cxx-bridge.c++

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ constexpr v8::ScriptCompiler::CompileOptions compileOptions = v8::ScriptCompiler
3636
auto data = ccIsolate.runInLockScope([&](CompileCacheIsolate::Lock& isolateLock) {
3737
return JSG_WITHIN_CONTEXT_SCOPE(isolateLock,
3838
isolateLock.newContext<CompilerCacheContext>().getHandle(isolateLock), [&](jsg::Lock& js) {
39-
auto resourceName = jsg::newExternalOneByteString(js, from<Rust>(path));
39+
auto resourceName = jsg::newExternalOneByteString(js, kj::from<Rust>(path));
4040
v8::ScriptOrigin origin(resourceName, resourceLineOffset, resourceColumnOffset,
4141
resourceIsSharedCrossOrigin, scriptId, {}, resourceIsOpaque, isWasm, isModule);
4242

43-
auto contentStr = jsg::newExternalOneByteString(js, from<Rust>(source));
43+
auto contentStr = jsg::newExternalOneByteString(js, kj::from<Rust>(source));
4444
auto source = v8::ScriptCompiler::Source(contentStr, origin, nullptr);
4545
auto module =
4646
jsg::check(v8::ScriptCompiler::CompileModule(js.v8Isolate, &source, compileOptions));

src/rust/kj/ffi.c++

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ kj::Promise<void> connect(HttpService& service,
1818
AsyncIoStream& connection,
1919
ConnectResponse& response,
2020
HttpConnectSettings settings) {
21-
auto strHost = kj::str(kj_rs::from<kj_rs::Rust>(host).asChars());
21+
auto strHost = kj::str(kj::from<kj_rs::Rust>(host).asChars());
2222
return service.connect(strHost, headers, connection, response,
2323
{
2424
.useTls = settings.use_tls,

src/rust/kj/ffi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ inline kj::Promise<void> request(HttpService& service,
9595
const HttpHeaders& headers,
9696
AsyncInputStream& request_body,
9797
HttpServiceResponse& response) {
98-
auto strUrl = kj::str(kj_rs::from<kj_rs::Rust>(url).asChars());
98+
auto strUrl = kj::str(kj::from<kj_rs::Rust>(url).asChars());
9999
co_await service.request(method, strUrl, headers, request_body, response);
100100
}
101101

src/rust/python-parser/import_parsing.c++

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ kj::Array<kj::String> parseImports(kj::ArrayPtr<kj::StringPtr> cpp_modules) {
1717
}
1818
::rust::Slice<::rust::Str const> rust_slice(rust_modules.begin(), rust_modules.size());
1919
auto rust_result = get_imports(rust_slice);
20-
return from<RustCopy>(rust_result);
20+
return kj::from<RustCopy>(rust_result);
2121
}
2222

2323
namespace workerd::api {

src/workerd/server/workerd-api.c++

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ Worker::Script::Module WorkerdApi::readModuleConf(config::Worker::Module::Reader
491491

492492
if (output.success) {
493493
return Worker::Script::EsModule{
494-
.body = ::kj_rs::from<Rust>(output.code), .ownBody = kj::mv(output.code)};
494+
.body = ::kj::from<Rust>(output.code), .ownBody = kj::mv(output.code)};
495495
}
496496

497497
auto description = kj::str("Error transpiling ", conf.getName(), " : ", output.error);

0 commit comments

Comments
 (0)